77 branches : [main]
88
99jobs :
10- ci :
10+ lint :
1111 runs-on : ubuntu-latest
12- timeout-minutes : 15
13- permissions :
14- contents : read
15- pull-requests : write
16- strategy :
17- matrix :
18- task : [lint, test, e2e]
1912 steps :
2013 - name : Checkout
2114 uses : actions/checkout@v5
@@ -34,41 +27,81 @@ jobs:
3427 - name : Install dependencies
3528 run : pnpm install
3629
37- - name : Install Playwright Browsers
38- if : matrix.task == 'e2e'
39- run : pnpm playwright install --with-deps
40-
4130 - name : Run lint
42- if : matrix.task == 'lint'
4331 run : pnpm lint:ci
4432
33+ unit_tests :
34+ runs-on : ubuntu-latest
35+ steps :
36+ - name : Checkout
37+ uses : actions/checkout@v5
38+
39+ - name : Install pnpm
40+ uses : pnpm/action-setup@v4
41+ with :
42+ run_install : false
43+
44+ - name : Install Node.js
45+ uses : actions/setup-node@v4
46+ with :
47+ node-version-file : " .nvmrc"
48+ cache : " pnpm"
49+
50+ - name : Install dependencies
51+ run : pnpm install
52+
4553 - name : Run tests
46- if : matrix.task == 'test'
4754 run : pnpm test:ci
4855
49- - name : Run e2e tests
50- if : matrix.task == 'e2e'
51- env :
52- AIRTABLE_PAT : ${{ secrets.AIRTABLE_PAT }}
53- run : pnpm test:e2e:headless
54-
5556 - name : Upload coverage artifact
56- if : matrix.task == 'test' && github.event_name == 'pull_request'
57+ if : github.event_name == 'pull_request'
5758 uses : actions/upload-artifact@v4
5859 with :
5960 name : vitest-coverage
6061 path : vitest-coverage
6162
63+ e2e_tests :
64+ runs-on : ubuntu-latest
65+ timeout-minutes : 15
66+ permissions :
67+ contents : read
68+ pull-requests : write
69+ steps :
70+ - name : Checkout
71+ uses : actions/checkout@v5
72+
73+ - name : Install pnpm
74+ uses : pnpm/action-setup@v4
75+ with :
76+ run_install : false
77+
78+ - name : Install Node.js
79+ uses : actions/setup-node@v4
80+ with :
81+ node-version-file : " .nvmrc"
82+ cache : " pnpm"
83+
84+ - name : Install dependencies
85+ run : pnpm install
86+
87+ - name : Install Playwright Browsers
88+ run : pnpm playwright install --with-deps
89+
90+ - name : Run e2e tests
91+ env :
92+ AIRTABLE_PAT : ${{ secrets.AIRTABLE_PAT }}
93+ run : pnpm test:e2e:headless
94+
6295 - name : Upload Playwright report
63- if : matrix.task == 'e2e' && failure()
96+ if : failure()
6497 uses : actions/upload-artifact@v4
6598 with :
6699 name : playwright-report
67100 path : playwright-report/
68101 retention-days : 30
69102
70103 - name : Comment PR with Playwright artifact link
71- if : matrix.task == 'e2e' && failure() && github.event_name == 'pull_request'
104+ if : failure() && github.event_name == 'pull_request'
72105 uses : actions/github-script@v7
73106 with :
74107 script : |
@@ -96,3 +129,26 @@ jobs:
96129 repo: repo.repo,
97130 body: comment
98131 });
132+
133+ report_coverage :
134+ runs-on : ubuntu-latest
135+ needs : unit_tests
136+ if : always() && github.event_name == 'pull_request'
137+ permissions :
138+ pull-requests : write
139+ steps :
140+ - uses : actions/checkout@v4
141+
142+ - name : Download Coverage Artifact
143+ uses : actions/download-artifact@v4
144+ with :
145+ name : vitest-coverage
146+ path : vitest-coverage
147+
148+ - name : Report Coverage
149+ uses : davelosert/vitest-coverage-report-action@v2
150+ with :
151+ github-token : ${{ secrets.GITHUB_TOKEN }}
152+ json-summary-path : vitest-coverage/coverage-summary.json
153+ json-final-path : vitest-coverage/coverage-final.json
154+ file-coverage-mode : changes
0 commit comments