11# This action runs lint checks and tests against the code.
22name : Check and Test
33
4- # Controls when the action will run.
54on :
65 pull_request :
76
8- # Allows you to run this workflow manually from the Actions tab
97 workflow_dispatch :
108 push :
119 branches :
@@ -18,7 +16,6 @@ concurrency:
1816 group : ${{ github.workflow }}-${{ github.ref }}
1917 cancel-in-progress : ${{ github.ref != 'refs/heads/main' }}
2018
21- # A workflow run is made up of one or more jobs that can run sequentially or in parallel
2219jobs :
2320 check-and-test :
2421 name : Check and Test
2825 strategy :
2926 matrix :
3027 os : [ubuntu-latest, windows-latest, macos-latest]
31-
3228 fail-fast : false
3329
34- # The type of runner that the job will run on
3530 runs-on : ${{ matrix.os }}
3631
3732 # Steps represent a sequence of tasks that will be executed as part of the job
@@ -51,22 +46,19 @@ jobs:
5146 if : ${{ runner.os == 'Linux' }}
5247 run : sudo apt-get -y update && sudo apt-get -y install libkrb5-dev libsecret-1-dev net-tools libstdc++6 gnome-keyring
5348
54- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
5549 - name : Checkout
5650 uses : actions/checkout@v4
5751 with :
5852 fetch-depth : 0
5953 submodules : recursive
54+ ref : ${{ github.event.pull_request.head.sha }}
6055
6156 - name : Setup Node.js
6257 uses : actions/setup-node@v4
6358 with :
6459 node-version : 20.x
6560 cache : " npm"
6661
67- - name : Install npm
68- run : npm install -g npm@9
69-
70627163 # Default Python (3.12) doesn't have support for distutils
7264 # https://github.com/nodejs/node-gyp/issues/2869
7971 # Dependencies are included when installing as npm workspaces will
8072 # hoist every package in the repo and it's important that the
8173 # dependencies of packages we are planning to test are also prepared
82- npm ci
8374 npm run bootstrap-ci -- --scope @mongodb-js/monorepo-tools --stream --include-dependencies
84- npm run bootstrap-ci -- --stream --since ${SINCE_REF} -- include-dependencies
75+ npm run bootstrap-ci -- --stream --include-dependencies
8576
8677 # saslprep source code may have been modified by bootstrapping,
8778 # depending on the OS, so undo that change if it has happened
@@ -97,12 +88,26 @@ jobs:
9788 shell : bash
9889
9990 - name : Run Checks
100- # We exclude dependents when running eslint and depchecks because
101- # linting and dependency checking is relevant only for packages where
102- # the source code was changed
103- run : npm run check-ci -- --stream --since ${SINCE_REF} --exclude-dependents
91+ run : npm run check-ci -- --stream
10492 shell : bash
10593
10694 - name : Run Tests
107- run : npm run test-ci -- --stream --since ${SINCE_REF}
95+ run : npm run test-ci -- --stream
10896 shell : bash
97+
98+ - name : Report Coverage
99+ if : ${{ runner.os == 'Linux' }}
100+ run : |
101+ curl -L https://coveralls.io/coveralls-linux.tar.gz | tar -xz -C /usr/local/bin
102+ coverage_reports=(packages/*/coverage/lcov.info)
103+ for report in "${coverage_reports[@]}"; do
104+ echo "Processing report: $report"
105+ flag_name=$(sed -E 's/packages\/([^\/]*)\/coverage\/lcov.info/\1/g' <<<$report)
106+ coveralls report --base-path . --job-flag=$flag_name $report --parallel --no-logo
107+ done
108+
109+ coveralls done
110+ env :
111+ COVERALLS_GIT_BRANCH : ${{ github.head_ref || github.ref_name }}
112+ COVERALLS_REPO_TOKEN : ${{ github.token }}
113+ COVERALLS_GIT_COMMIT : ${{ github.event.pull_request.head.sha || github.sha }}
0 commit comments