File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : " Build and test"
2+ on :
3+ # Runs on pushes targeting the default branch
4+ push :
5+ branches : ["master"]
6+ # pull_request:
7+ # Allows you to run this workflow manually from the Actions tab
8+ workflow_dispatch :
9+
10+ jobs :
11+ test :
12+ runs-on : ubuntu-latest
13+
14+ permissions :
15+ # Required to checkout the code
16+ contents : read
17+ # Required to put a comment into the pull-request
18+ # pull-requests: write
19+
20+ steps :
21+ - uses : actions/checkout@v4
22+ - name : " Install Node"
23+ uses : actions/setup-node@v4
24+ with :
25+ node-version : " 20.x"
26+ - name : " Install Deps"
27+ run : npm install
28+ - name : " Build Next.js"
29+ run : npm run build
30+ - name : " Test"
31+ run : npx vitest --coverage.enabled true
32+ - name : " Report Coverage"
33+ # Set if: always() to also generate the report if tests are failing
34+ # Only works if you set `reportOnFailure: true` in your vite config as specified above
35+ if : always()
36+ uses : davelosert/vitest-coverage-report-action@v2
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ export default defineConfig({
66 globals : true ,
77 environment : "node" ,
88 setupFiles : [ "./__tests__/setup.ts" ] ,
9+ reporters : process . env . GITHUB_ACTIONS
10+ ? [ "dot" , "github-actions" ]
11+ : [ "default" ] ,
912 } ,
1013 plugins : [ tsconfigPaths ( ) ] ,
1114} ) ;
You can’t perform that action at this time.
0 commit comments