1
1
# This action runs lint checks and tests against the code.
2
2
name : Check and Test
3
3
4
- # Controls when the action will run.
5
4
on :
6
5
pull_request :
7
6
8
- # Allows you to run this workflow manually from the Actions tab
9
7
workflow_dispatch :
10
8
push :
11
9
branches :
@@ -18,7 +16,6 @@ concurrency:
18
16
group : ${{ github.workflow }}-${{ github.ref }}
19
17
cancel-in-progress : ${{ github.ref != 'refs/heads/main' }}
20
18
21
- # A workflow run is made up of one or more jobs that can run sequentially or in parallel
22
19
jobs :
23
20
check-and-test :
24
21
name : Check and Test
28
25
strategy :
29
26
matrix :
30
27
os : [ubuntu-latest, windows-latest, macos-latest]
31
-
32
28
fail-fast : false
33
29
34
- # The type of runner that the job will run on
35
30
runs-on : ${{ matrix.os }}
36
31
37
32
# Steps represent a sequence of tasks that will be executed as part of the job
@@ -51,21 +46,18 @@ jobs:
51
46
if : ${{ runner.os == 'Linux' }}
52
47
run : sudo apt-get -y update && sudo apt-get -y install libkrb5-dev libsecret-1-dev net-tools libstdc++6 gnome-keyring
53
48
54
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
55
49
- name : Checkout
56
50
uses : actions/checkout@v4
57
51
with :
58
52
fetch-depth : 0
53
+ ref : ${{ github.event.pull_request.head.sha }}
59
54
60
55
- name : Setup Node.js
61
56
uses : actions/setup-node@v4
62
57
with :
63
58
node-version : 20.x
64
59
cache : " npm"
65
60
66
- - name : Install npm
67
- run : npm install -g npm@9
68
-
69
61
70
62
# Default Python (3.12) doesn't have support for distutils
71
63
# https://github.com/nodejs/node-gyp/issues/2869
@@ -95,12 +87,26 @@ jobs:
95
87
shell : bash
96
88
97
89
- name : Run Checks
98
- # We exclude dependents when running eslint and depchecks because
99
- # linting and dependency checking is relevant only for packages where
100
- # the source code was changed
101
90
run : npm run check-ci -- --stream
102
91
shell : bash
103
92
104
93
- name : Run Tests
105
94
run : npm run test-ci -- --stream
106
95
shell : bash
96
+
97
+ - name : Report Coverage
98
+ if : ${{ runner.os == 'Linux' }}
99
+ run : |
100
+ curl -L https://coveralls.io/coveralls-linux.tar.gz | tar -xz -C /usr/local/bin
101
+ coverage_reports=(packages/*/coverage/lcov.info)
102
+ for report in "${coverage_reports[@]}"; do
103
+ echo "Processing report: $report"
104
+ flag_name=$(sed -E 's/packages\/([^\/]*)\/coverage\/lcov.info/\1/g' <<<$report)
105
+ coveralls report --base-path . --job-flag=$flag_name $report --parallel --no-logo
106
+ done
107
+
108
+ coveralls done
109
+ env :
110
+ COVERALLS_GIT_BRANCH : ${{ github.head_ref || github.ref_name }}
111
+ COVERALLS_REPO_TOKEN : ${{ github.token }}
112
+ COVERALLS_GIT_COMMIT : ${{ github.event.pull_request.head.sha || github.sha }}
0 commit comments