File tree 2 files changed +54
-5
lines changed
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 20
20
with :
21
21
node-version : " 18"
22
22
23
- # Cache yarn dependencies (optional but speeds up the process)
23
+ # Cache yarn dependencies
24
24
- name : Cache yarn dependencies
25
25
uses : actions/cache@v3
26
26
with :
29
29
restore-keys : |
30
30
${{ runner.os }}-yarn-
31
31
32
- # Install dependencies with yarn
33
- - name : Install dependencies with yarn
32
+ # Install dependencies
33
+ - name : Install dependencies
34
34
run : yarn install
35
35
36
36
# Run tests
41
41
- name : Run coverage
42
42
run : yarn coverage
43
43
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
46
46
uses : coverallsapp/github-action@v2
47
47
with :
48
48
github-token : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments