ci: track coverage with codecov.io instead of codeclimate.com.

Comparison:

* Codecov has a simpler integration and a better UI.
* Codeclimate tracks both linter warnings (Rubocop, ESLint) and code
  coverage, but its UI for code coverage is worse than Codecov's.
* Codeclimate doesn't support Simplecov 0.18 because Codeclimate doesn't
  support 0.18's new coverage format yet.
This commit is contained in:
evazion
2020-06-27 11:52:19 -05:00
parent da40a1cb73
commit 09dff5b929
6 changed files with 17 additions and 24 deletions

View File

@@ -34,10 +34,7 @@ jobs:
RUBYOPT: -W0 # silence ruby warnings
VIPS_WARNING: 0 # silence libvips warnings
# Code Climate configuration. https://docs.codeclimate.com/docs/finding-your-test-coverage-token
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GIT_COMMIT_SHA: ${{ github.sha }}
GIT_BRANCH: ${{ github.ref }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
DATABASE_URL: postgresql://danbooru:danbooru@postgres/danbooru
ARCHIVE_DATABASE_URL: postgresql://danbooru:danbooru@postgres/danbooru
@@ -74,7 +71,7 @@ jobs:
- name: Install OS dependencies
run: |
apt-get update
apt-get -y install --no-install-recommends build-essential ruby ruby-dev ruby-bundler git nodejs yarnpkg webpack ffmpeg mkvtoolnix libvips-dev libxml2-dev libxslt-dev zlib1g-dev postgresql-server-dev-all wget
apt-get -y install --no-install-recommends build-essential ruby ruby-dev ruby-bundler git nodejs yarnpkg webpack ffmpeg mkvtoolnix libvips-dev libxml2-dev libxslt-dev zlib1g-dev postgresql-server-dev-all wget curl
ln -sf /usr/bin/yarnpkg /usr/bin/yarn
- name: Install Ruby dependencies
@@ -86,23 +83,5 @@ jobs:
- name: Prepare database
run: config/docker/prepare-tests.sh
# https://docs.codeclimate.com/docs/configuring-test-coverage
- name: Prepare test coverage for Code Climate
run: |
wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
chmod +x test-reporter-latest-linux-amd64
./test-reporter-latest-linux-amd64 before-build
- name: Run tests
run: bin/rails test
- name: Upload test coverage to Code Climate
if: ${{ !cancelled() }}
run: GIT_COMMITTED_AT="$(date -u +%s)" ./test-reporter-latest-linux-amd64 after-build --debug
# https://docs.codecov.io/docs
- name: Upload test coverage to Codecov.io
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}