Skip to content

Commit 26a21b6

Browse files
authored
chore(ci): enable coveralls MONGOSH-2125 (#524)
* chore: enable coveralls reporting * fix command name * fix shell script * use parallel * clean up * remove commit argument * try to get the commit right * fix env variable name * remove --debug
1 parent 29482a4 commit 26a21b6

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

.github/workflows/check-test.yaml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# This action runs lint checks and tests against the code.
22
name: Check and Test
33

4-
# Controls when the action will run.
54
on:
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
2219
jobs:
2320
check-and-test:
2421
name: Check and Test
@@ -28,10 +25,8 @@ jobs:
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,21 +46,18 @@ 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
53+
ref: ${{ github.event.pull_request.head.sha }}
5954

6055
- name: Setup Node.js
6156
uses: actions/setup-node@v4
6257
with:
6358
node-version: 20.x
6459
cache: "npm"
6560

66-
- name: Install npm
67-
run: npm install -g npm@9
68-
6961
- name: Use [email protected]
7062
# Default Python (3.12) doesn't have support for distutils
7163
# https://github.com/nodejs/node-gyp/issues/2869
@@ -95,12 +87,26 @@ jobs:
9587
shell: bash
9688

9789
- 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
10190
run: npm run check-ci -- --stream
10291
shell: bash
10392

10493
- name: Run Tests
10594
run: npm run test-ci -- --stream
10695
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

Comments
 (0)