-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable Ruby testing github workflow (#1994)
* Enable Ruby testing github workflow * change `ruby-version` => `ruby` in matrix * disable fail-fast * Use lastest of each minor version * add code climate reporting the Travis builds reported results back to code climate, and this restores that. @stympy We should move the the CC Reporter Id to the [repo's secrets](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) and regenerate it (for safety). I'm unable to do that as accessing the repo's secrets requires `admin` permissions. * Use the GitHub action badge in the README * link directly to tests
- Loading branch information
Showing
2 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake | ||
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby | ||
|
||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
name: Ruby ${{ matrix.ruby }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false # don't fail all matrix builds if one fails | ||
matrix: | ||
ruby: | ||
- '2.3' | ||
- '2.4' | ||
- '2.5' | ||
- '2.6' | ||
- '2.7' | ||
- 'head' | ||
continue-on-error: ${{ endsWith(matrix.ruby, 'head') }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
|
||
- name: Install dependencies | ||
run: bundle install | ||
|
||
- name: Setup Code Climate test-reporter | ||
run: | | ||
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | ||
chmod +x ./cc-test-reporter | ||
./cc-test-reporter before-build | ||
- name: Run tests | ||
run: bundle exec rake | ||
|
||
- name: Publish code coverage | ||
env: | ||
CC_TEST_REPORTER_ID: c9b8356df2031a5a72462555fe898245cf24d83c7bb82c40ddb5c6c6976c4319 | ||
# CC_TEST_REPORTER_ID: ${{ secrets.CodeClimateReporterId }} | ||
run: | | ||
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" | ||
./cc-test-reporter after-build -r $CC_TEST_REPORTER_ID |
This file contains 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