1
+ name : Full Test
2
+ on :
3
+ pull_request :
4
+ types : [opened, synchronize]
5
+
6
+ env :
7
+ INTEGRATION_TEST_SPREADSHEET_ID : ${{ secrets.INTEGRATION_TEST_SPREADSHEET_ID }}
8
+ INTEGRATION_TEST_AUTH_JSON : ${{ secrets.INTEGRATION_TEST_AUTH_JSON }}
9
+
10
+ jobs :
11
+ full_test :
12
+ runs-on : ubuntu-latest
13
+ strategy :
14
+ matrix :
15
+ node-version : ['22.x'] # Can expand if needed
16
+
17
+ if : github.event.review.state == 'approved' || github.event.pull_request.user.login == 'edocsss'
18
+
19
+ steps :
20
+ - uses : actions/checkout@v3
21
+ with :
22
+ ref : ${{ github.head_ref }}
23
+
24
+ - name : Dump GitHub context
25
+ env :
26
+ GITHUB_CONTEXT : ${{ toJson(github) }}
27
+ run : echo "$GITHUB_CONTEXT"
28
+
29
+ - name : Setup Node.js ${{ matrix.node-version }}
30
+ uses : actions/setup-node@v3
31
+ with :
32
+ node-version : ${{ matrix.node-version }}
33
+ cache : ' npm'
34
+
35
+ - name : Install dependencies
36
+ run : npm ci
37
+
38
+ - name : Compile TypeScript
39
+ run : npx tsc --noEmit
40
+
41
+ - name : Run Unit Tests with Coverage
42
+ run : |
43
+ npm run test -- --coverage
44
+ cp coverage/lcov.info coverage.out
45
+
46
+ - name : Generate Coverage Badge
47
+ uses : tj-actions/coverage-badge-js@v1
48
+ with :
49
+ green : 80
50
+ coverage-summary-path : coverage/coverage-summary.json
51
+
52
+ - name : Add Coverage Badge
53
+ uses : stefanzweifel/git-auto-commit-action@v4
54
+ id : auto-commit-action
55
+ with :
56
+ commit_message : Apply Code Coverage Badge
57
+ skip_fetch : true
58
+ skip_checkout : true
59
+ file_pattern : ./README.md
60
+
61
+ - name : Push Changes
62
+ if : steps.auto-commit-action.outputs.changes_detected == 'true'
63
+ uses : ad-m/github-push-action@master
64
+ with :
65
+ github_token : ${{ github.token }}
66
+ branch : ${{ github.head_ref }}
0 commit comments