@@ -14,31 +14,18 @@ permissions:
1414env :
1515 IMAGE_REGISTRY : ghcr.io
1616 IMAGE_NAME : ${{ github.repository }}
17- PNPM_VERSION : 10.27.0
18- NODE_VERSION : 24.12.0
1917 HUSKY : 0
2018
2119jobs :
2220 test :
23- name : Build apps and run tests
21+ name : Run unit, lint and e2e tests
2422 runs-on : ubuntu-latest
2523 steps :
2624 - name : Checkout repository
2725 uses : actions/checkout@v4
2826
29- - name : Setup pnpm
30- uses : pnpm/action-setup@v3
31- with :
32- version : ${{ env.PNPM_VERSION }}
33-
34- - name : Set up Node.js
35- uses : actions/setup-node@v4
36- with :
37- node-version : ${{ env.NODE_VERSION }}
38- cache : ' pnpm'
39-
40- - name : Install dependencies
41- run : pnpm install --frozen-lockfile
27+ - name : Setup repository
28+ uses : ./.github/workflows/actions/setup-repository
4229
4330 - name : Setup ESLint cache
4431 uses : actions/cache@v4
@@ -61,15 +48,44 @@ jobs:
6148 - name : Start genesis and ocular
6249 run : |
6350 docker pull ghcr.io/simonwep/genesis:latest
64- pnpm dev:backend &
65- pnpm preview &
51+ docker run -p 8080:8080 -v "./.data:/app/.data" --env-file .env.genesis ghcr.io/simonwep/genesis:latest start &
52+ pnpm vite preview &
53+
54+ - name : Wait for genesis to be healthy
55+ uses : ./.github/workflows/actions/wait-for-health-check
56+ with :
57+ host : localhost:8080
58+
59+ - name : Wait for ocular to be healthy
60+ uses : ./.github/workflows/actions/wait-for-health-check
61+ with :
62+ host : localhost:3000
63+ endpoint : /dashboard
6664
6765 - name : Install playwright browsers
6866 run : pnpm exec playwright install --with-deps firefox
6967
7068 - name : Run e2e tests
7169 run : pnpm test:e2e
7270
71+ - name : Upload test results
72+ uses : actions/upload-artifact@v4
73+ if : ${{ failure() }}
74+ with :
75+ name : test-results
76+ path : test-results/
77+ retention-days : 7
78+
79+ build :
80+ name : Run demo and docs build
81+ runs-on : ubuntu-latest
82+ steps :
83+ - name : Checkout repository
84+ uses : actions/checkout@v4
85+
86+ - name : Setup repository
87+ uses : ./.github/workflows/actions/setup-repository
88+
7389 - name : Set outputs
7490 id : vars
7591 run : echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
84100 OCULAR_BUILD_SHA : ${{ steps.vars.outputs.sha_short }}
85101 OCULAR_BASE_URL : /ocular/demo/
86102
103+ - name : Build docs
104+ run : pnpm docs:build
105+
87106 - name : Upload app build
88107 uses : actions/upload-artifact@v4
89108 if : github.ref == 'refs/heads/main'
@@ -100,18 +119,10 @@ jobs:
100119 path : docs/.vitepress/dist
101120 retention-days : 1
102121
103- - name : Upload test results
104- uses : actions/upload-artifact@v4
105- if : ${{ failure() }}
106- with :
107- name : test-results
108- path : test-results/
109- retention-days : 7
110-
111122 publish_docs :
112123 if : github.ref == 'refs/heads/main'
113124 name : Publish docs
114- needs : test
125+ needs : [build, test]
115126 runs-on : ubuntu-latest
116127 permissions :
117128 pages : write
@@ -151,7 +162,7 @@ jobs:
151162 publish_docker :
152163 if : startsWith(github.event.ref, 'refs/tags/v')
153164 name : Build and publish docker image
154- needs : test
165+ needs : [build, test]
155166 runs-on : ubuntu-latest
156167 permissions :
157168 contents : read
0 commit comments