-
Notifications
You must be signed in to change notification settings - Fork 8
chore(ci): enable coveralls MONGOSH-2125 #524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c24b804
chore: enable coveralls reporting
nirinchev 748c9c4
fix command name
nirinchev 177bf60
fix shell script
nirinchev 08fe66c
use parallel
nirinchev ff62f94
clean up
nirinchev 0b34b86
remove commit argument
nirinchev 8826286
try to get the commit right
nirinchev 6e4e7da
fix env variable name
nirinchev cfdb85f
remove --debug
nirinchev c557649
Merge branch 'main' into ni/coveralls
nirinchev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
# This action runs lint checks and tests against the code. | ||
name: Check and Test | ||
|
||
# Controls when the action will run. | ||
on: | ||
pull_request: | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
|
@@ -18,7 +16,6 @@ concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
check-and-test: | ||
name: Check and Test | ||
|
@@ -28,10 +25,8 @@ jobs: | |
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
fail-fast: false | ||
|
||
# The type of runner that the job will run on | ||
runs-on: ${{ matrix.os }} | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
|
@@ -51,21 +46,18 @@ jobs: | |
if: ${{ runner.os == 'Linux' }} | ||
run: sudo apt-get -y update && sudo apt-get -y install libkrb5-dev libsecret-1-dev net-tools libstdc++6 gnome-keyring | ||
|
||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
cache: "npm" | ||
|
||
- name: Install npm | ||
run: npm install -g npm@9 | ||
|
||
- name: Use [email protected] | ||
# Default Python (3.12) doesn't have support for distutils | ||
# https://github.com/nodejs/node-gyp/issues/2869 | ||
|
@@ -95,12 +87,26 @@ jobs: | |
shell: bash | ||
|
||
- name: Run Checks | ||
# We exclude dependents when running eslint and depchecks because | ||
# linting and dependency checking is relevant only for packages where | ||
# the source code was changed | ||
run: npm run check-ci -- --stream | ||
shell: bash | ||
|
||
- name: Run Tests | ||
run: npm run test-ci -- --stream | ||
shell: bash | ||
|
||
- name: Report Coverage | ||
if: ${{ runner.os == 'Linux' }} | ||
run: | | ||
curl -L https://coveralls.io/coveralls-linux.tar.gz | tar -xz -C /usr/local/bin | ||
coverage_reports=(packages/*/coverage/lcov.info) | ||
for report in "${coverage_reports[@]}"; do | ||
echo "Processing report: $report" | ||
flag_name=$(sed -E 's/packages\/([^\/]*)\/coverage\/lcov.info/\1/g' <<<$report) | ||
coveralls report --base-path . --job-flag=$flag_name $report --parallel --no-logo | ||
done | ||
|
||
coveralls done | ||
env: | ||
COVERALLS_GIT_BRANCH: ${{ github.head_ref || github.ref_name }} | ||
COVERALLS_REPO_TOKEN: ${{ github.token }} | ||
COVERALLS_GIT_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi if you haven't considered it already: coveralls does have an official github action that could be worth considering, didn't look too much into it though, might not fit our setup: https://github.com/marketplace/actions/coveralls-github-action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I looked at it, but the problem with it is that it's designed to report the results of a single package run, so I'd have to either add 20 steps to report coverage from each of the packages in the monorepo, or completely change how we're running CI to make it run one job per package in a matrix. The official action is using the CLI like we are and I did consult with its implementation when working on our reporting.