Skip to content

Bump pafs_core from 627d8d8 to 673169d (#760) #1190

Bump pafs_core from 627d8d8 to 673169d (#760)

Bump pafs_core from 627d8d8 to 673169d (#760) #1190

Workflow file for this run

name: CI
on: push
jobs:
build:
runs-on: ubuntu-20.04
env:
DEVISE_MAILER_SENDER: no-reply@example.com
POSTGRES_HOST: localhost
POSTGRES_PASSWORD: postgres
POSTGRES_PORT: 5432
POSTGRES_USERNAME: postgres
SECRET_KEY_BASE: somescarylongvaluefullofnumbersandlettersi
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pafs_test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
# 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
- name: Database setup
run: |
RAILS_ENV=test bundle exec rake db:create --trace --trace
RAILS_ENV=test bundle exec rake db:schema:load --trace --trace
# 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 coverage.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 coverage.json
# https://community.sonarsource.com/t/code-coverage-doesnt-work-with-github-action/16747/6
- name: Run tests
run: |
bundle exec rspec
sed -i 's/\/home\/runner\/work\/pafs-user\/pafs-user\//\/github\/workspace\//g' coverage/coverage.json
env:
POL_FAILURE_NOTIFICATION_EMAIL: foo
- 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