Skip to content

Commit

Permalink
CI: Add a GitHub Actions workflow to run specs and rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
DeeDeeG committed Apr 28, 2024
1 parent aa22bf7 commit 494ef96
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/specs-and-rubocop.yml
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

0 comments on commit 494ef96

Please sign in to comment.