@@ -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
@@ -52,18 +39,53 @@ jobs:
5239 - name : Run unit tests
5340 run : pnpm test
5441
55- - name : Build app
42+ - name : Build testing app
5643 run : pnpm build
44+ env :
45+ OCULAR_GENESIS_HOST : /api
46+ OCULAR_HYBRID_MODE : true
5747
58- - name : Build docs
59- run : pnpm docs:build
48+ - name : Start genesis and ocular
49+ run : |
50+ docker pull ghcr.io/simonwep/genesis:latest
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
6064
6165 - name : Install playwright browsers
6266 run : pnpm exec playwright install --with-deps firefox
6367
6468 - name : Run e2e tests
6569 run : pnpm test:e2e
6670
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+
6789 - name : Set outputs
6890 id : vars
6991 run : echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
7597 OCULAR_BUILD_SHA : ${{ steps.vars.outputs.sha_short }}
7698 OCULAR_BASE_URL : /ocular/demo/
7799
100+ - name : Build docs
101+ run : pnpm docs:build
102+
78103 - name : Upload app build
79104 uses : actions/upload-artifact@v4
80105 if : github.ref == 'refs/heads/main'
@@ -91,18 +116,10 @@ jobs:
91116 path : docs/.vitepress/dist
92117 retention-days : 1
93118
94- - name : Upload test results
95- uses : actions/upload-artifact@v4
96- if : ${{ failure() }}
97- with :
98- name : test-results
99- path : test-results/
100- retention-days : 7
101-
102119 publish_docs :
103120 if : github.ref == 'refs/heads/main'
104121 name : Publish docs
105- needs : test
122+ needs : [build, test]
106123 runs-on : ubuntu-latest
107124 permissions :
108125 pages : write
@@ -142,7 +159,7 @@ jobs:
142159 publish_docker :
143160 if : startsWith(github.event.ref, 'refs/tags/v')
144161 name : Build and publish docker image
145- needs : test
162+ needs : [build, test]
146163 runs-on : ubuntu-latest
147164 permissions :
148165 contents : read
0 commit comments