forked from RefugeRestrooms/refugerestrooms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add a GitHub Actions workflow to run specs and rubocop
- Loading branch information
Showing
1 changed file
with
40 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,40 @@ | ||
name: Specs and Rubocop | ||
on: | ||
pull_request: | ||
push: | ||
env: | ||
CC_TEST_REPORTER_ID: c18df080592f9c99ca8080a6d5e052aa5fd3964044a0fe0b71e48f8e18998dc2 | ||
|
||
jobs: | ||
specs-and-rubocop: | ||
name: Specs and Rubocop | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the latest code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup codeclimate | ||
continue-on-error: true | ||
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 docker-compose build | ||
run: docker-compose build | ||
|
||
- name: Run rubocop | ||
run: docker-compose run web rubocop | ||
|
||
- name: Run specs | ||
run: docker-compose run -e "RAILS_ENV=test" web rake db:test:prepare spec | ||
|
||
- name: Report results to codeclimate (for job success) | ||
if: ${{ success() }} | ||
continue-on-error: true | ||
run: ./cc-test-reporter after-build --exit-code 0 --prefix /refugerestrooms | ||
|
||
- name: Report results to codeclimate (for job failure) | ||
if: ${{ failure() }} | ||
continue-on-error: true | ||
run: ./cc-test-reporter after-build --exit-code 1 --prefix /refugerestrooms |