Integrate coveralls with github actions
Somehow I thought it worked automatically, but we had to provide the token. The configuration is based on Coveralls instructions to run parallel builds [1]. Alternatively we could use the Coveralls GitHub Action [2] which slightly simplifies the workflow configuration and removes the dependency of the coveralls gem. However, it also adds a dependency on simplecov-lcov and requires configuring it to renerate LCOV files on each run, so the benefits of using it are not that big. [1] https://docs.coveralls.io/parallel-build-webhook [2] https://github.com/coverallsapp/github-action/
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
service_name: travis-ci
|
|
||||||
14
.github/workflows/tests.yml
vendored
14
.github/workflows/tests.yml
vendored
@@ -19,10 +19,13 @@ jobs:
|
|||||||
POSTGRES_USER: consul
|
POSTGRES_USER: consul
|
||||||
POSTGRES_PASSWORD: ""
|
POSTGRES_PASSWORD: ""
|
||||||
env:
|
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 }}
|
||||||
PGUSER: consul
|
PGUSER: consul
|
||||||
POSTGRES_HOST: postgres
|
POSTGRES_HOST: postgres
|
||||||
RAILS_ENV: test
|
RAILS_ENV: test
|
||||||
COVERALLS: true
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -55,3 +58,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: screenshots
|
name: screenshots
|
||||||
path: tmp/screenshots
|
path: tmp/screenshots
|
||||||
|
coveralls:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
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"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
ENV["RAILS_ENV"] ||= "test"
|
ENV["RAILS_ENV"] ||= "test"
|
||||||
if ENV["COVERALLS"]
|
if ENV["COVERALLS_REPO_TOKEN"]
|
||||||
require "coveralls"
|
require "coveralls"
|
||||||
Coveralls.wear!("rails")
|
Coveralls.wear!("rails")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user