Skip to content

Commit

Permalink
collect coverage on every version, merge, upload to coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
jonchurch committed May 25, 2024
1 parent 03d1b75 commit bf249d0
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions .github/workflows/experimental.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,51 @@ jobs:
- name: Remove non-test dependencies
run: npm rm --silent --save-dev connect-redis

- name: Run tests
run: npm test

- name: Output Node and NPM versions
run: |
echo "Node.js version: $(node -v)"
echo "NPM version: $(npm -v)"
- name: Run tests
shell: bash
run: |
npm run test-ci
cp coverage/lcov.info "coverage/${{ matrix.name }}.lcov"
- name: Collect code coverage
run: |
mv ./coverage "./${{ matrix.name }}"
mkdir ./coverage
mv "./${{ matrix.name }}" "./coverage/${{ matrix.name }}"
- name: Upload code coverage
uses: actions/upload-artifact@v3
with:
name: coverage
path: ./coverage
retention-days: 1

coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install lcov
shell: bash
run: sudo apt-get -y install lcov

- name: Collect coverage reports
uses: actions/download-artifact@v3
with:
name: coverage
path: ./coverage

- name: Merge coverage reports
shell: bash
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info

- name: Upload coverage report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit bf249d0

Please sign in to comment.