File tree Expand file tree Collapse file tree 2 files changed +54
-5
lines changed Expand file tree Collapse file tree 2 files changed +54
-5
lines changed Original file line number Diff line number Diff line change 1+ name : Upload Test Coverage to Coveralls
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ upload-coverage :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ # Checkout the code
14+ - name : Checkout repository
15+ uses : actions/checkout@v3
16+
17+ # Set up Node.js
18+ - name : Set up Node.js
19+ uses : actions/setup-node@v3
20+ with :
21+ node-version : " 18"
22+
23+ # Cache yarn dependencies
24+ - name : Cache yarn dependencies
25+ uses : actions/cache@v3
26+ with :
27+ path : ~/.cache/yarn
28+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
29+ restore-keys : |
30+ ${{ runner.os }}-yarn-
31+
32+ # Install dependencies
33+ - name : Install dependencies
34+ run : yarn install
35+
36+ # Run tests
37+ - name : Run tests
38+ run : yarn test
39+
40+ # Run coverage
41+ - name : Run coverage
42+ run : yarn coverage
43+
44+ # Upload coverage results
45+ - name : Upload coverage to Coveralls
46+ uses : coverallsapp/github-action@v2
47+ with :
48+ coveralls-token : ${{ secrets.COVERALLS_TOKEN }}
49+ if : success()
Original file line number Diff line number Diff line change 2020 with :
2121 node-version : " 18"
2222
23- # Cache yarn dependencies (optional but speeds up the process)
23+ # Cache yarn dependencies
2424 - name : Cache yarn dependencies
2525 uses : actions/cache@v3
2626 with :
2929 restore-keys : |
3030 ${{ runner.os }}-yarn-
3131
32- # Install dependencies with yarn
33- - name : Install dependencies with yarn
32+ # Install dependencies
33+ - name : Install dependencies
3434 run : yarn install
3535
3636 # Run tests
4141 - name : Run coverage
4242 run : yarn coverage
4343
44- # Upload coverage results (using Coveralls or another service)
45- - name : Upload coverage to coveralls
44+ # Upload coverage results
45+ - name : Upload coverage to Coveralls
4646 uses : coverallsapp/github-action@v2
4747 with :
4848 github-token : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments