-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Github action that runs all build steps
As per the previous travis.yml file we'll use a matrix to cover the supported versions of Ruby and Rails in all combinations. Unlike the previous version now we'll only run the following steps once (for the latest Ruby and Rails pairing): * Nanoc link check * CodeClimate setup * CodeClimate report submission It's unnecessary to run these multiple times
- Loading branch information
1 parent
88f1211
commit 8e2c3a0
Showing
1 changed file
with
51 additions
and
0 deletions.
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,51 @@ | ||
name: Testing | ||
on: | ||
- pull_request | ||
jobs: | ||
rspec: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby: ['2.5.8', '2.6.6', '2.7.2'] | ||
rails: ['5.2.4', '6.0.3'] | ||
runs-on: ubuntu-20.04 | ||
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
|
||
- name: Install gems | ||
env: | ||
RAILS_VERSION: ${{ matrix.rails }} | ||
run: | | ||
gem install bundler | ||
bundle install --jobs 4 --retry 3 | ||
- name: Run Rubocop | ||
run: make ruby-lint | ||
|
||
- name: Download CodeClimate reporter | ||
if: ${{ matrix.ruby == '2.7.2' && matrix.rails == '6.0.3' }} | ||
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 RSpec | ||
run: make rspec | ||
|
||
- name: Report coverage to CodeClimate | ||
if: ${{ matrix.ruby == '2.7.2' && matrix.rails == '6.0.3' }} | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
GIT_BRANCH: ${{ steps.extract_branch.outputs.branch }} | ||
GIT_COMMIT_SHA: ${{ github.sha }} | ||
run: ./cc-test-reporter after-build -t simplecov | ||
|
||
- name: Run Nanoc Check | ||
if: ${{ matrix.ruby == '2.7.2' && matrix.rails == '6.0.3' }} | ||
run: make nanoc-check-all |