-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from Travis CI to GitHub Actions (#13)
https://eaflood.atlassian.net/browse/RUBY-1229 We have decided to switch from Travis CI to GitHub Actions. This PR updates our config and readme. * Fix linter issue
- Loading branch information
1 parent
8f0fd1e
commit e650a2d
Showing
5 changed files
with
47 additions
and
26 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,43 @@ | ||
name: CI | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
# You must use a Linux environment when using service containers or container jobs | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Downloads a copy of the code in your repository before running CI tests | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of sonarcloud analysis | ||
|
||
# We don't have to specify the ruby version, or grab it from .ruby-verion. This action supports reading the | ||
# version from .ruby-verion itself | ||
- name: Install Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | ||
|
||
# Run linting first. No point running the tests if there is a linting issue | ||
- name: Run lint check | ||
run: | | ||
bundle exec rubocop --format progress --format json --out rubocop-result.json | ||
# This includes an extra run step. The sonarcloud analysis will be run in a docker container with the current | ||
# folder mounted as `/github/workspace`. The problem is when the .resultset.json file is generated it will | ||
# reference the code in the current folder. So to enable sonarcloud to matchup code coverage with the files we use | ||
# sed to update the references in .resultset.json | ||
# https://community.sonarsource.com/t/code-coverage-doesnt-work-with-github-action/16747/6 | ||
- name: Run unit tests | ||
run: | | ||
bundle exec rspec | ||
sed -i 's/\/home\/runner\/work\/defra-ruby-alert\/defra-ruby-alert\//\/github\/workspace\//g' coverage/.resultset.json | ||
- name: Analyze with SonarCloud | ||
uses: sonarsource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This is provided automatically by GitHub | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # This needs to be set in your repo; settings -> secrets |
This file was deleted.
Oops, something went wrong.
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
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
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