Use Coveralls Github Action to send test reports

Coveralls stopped working back in July when we reached build number 3790
because back when we used Travis we created builds from numbers 3791 to
35700.

After trying to change the numbers in several ways, all of them
resulting in a "No build matching CI build number" message, we're trying
the Github Action provided by Coveralls instead. In order to make it
work, we need to add the `simplecov-lcov` gem and generate the report at
`coverage/lcov.info`. Note that, for some reason, `simplecov-lcov`
doesn't seem to depend on `simplecov` and we need `simplecov` 0.18 or
later, so we're manually adding this dependency as well.
This commit is contained in:
Javi Martín
2022-11-28 17:07:07 +01:00
parent e3aba17470
commit 8ed8cc8b93
5 changed files with 33 additions and 30 deletions

View File

@@ -23,10 +23,7 @@ jobs:
POSTGRES_USER: consul
POSTGRES_PASSWORD: ""
env:
CI_BUILD_NUMBER: ${{ github.run_number }}
COVERALLS_FLAG_NAME: run-${{ matrix.ci_node_index }}
COVERALLS_PARALLEL: true
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
TEST_COVERAGE: 1
PGUSER: consul
POSTGRES_HOST: postgres
RAILS_ENV: test
@@ -56,6 +53,12 @@ jobs:
KNAPSACK_PRO_FIXED_QUEUE_SPLIT: true
KNAPSACK_PRO_LOG_LEVEL: info
run: bin/knapsack_pro_rspec
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.ci_node_index }}
parallel: true
- name: Upload screenshots
if: failure()
uses: actions/upload-artifact@v2
@@ -67,9 +70,9 @@ jobs:
contents: none
runs-on: ubuntu-latest
needs: tests
env:
CI_BUILD_NUMBER: ${{ github.run_number }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
steps:
- name: Finish coveralls
run: curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CI_BUILD_NUMBER&payload[status]=done"
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true