Bump rubocop-rspec from 2.29.1 to 3.0.4 #1555
Workflow file for this run
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
name: CI | |
on: push | |
jobs: | |
build: | |
# You must use a Linux environment when using service containers or container jobs | |
runs-on: ubuntu-20.04 | |
env: | |
ADDRESS_FACADE_CLIENT_ID: ${{ secrets.ACTIONS_ADDRESS_FACADE_CLIENT_ID }} | |
ADDRESS_FACADE_CLIENT_KEY: ${{ secrets.ACTIONS_ADDRESS_FACADE_CLIENT_KEY }} | |
COMPANIES_HOUSE_API_KEY: ${{ secrets.COMPANIES_HOUSE_API_KEY }} | |
DEVISE_MAILER_SENDER: "John Smith <[email protected]>" | |
EMAIL_HOST: localhost | |
EMAIL_PORT: 2500 | |
NOTIFY_API_KEY: ${{ secrets.NOTIFY_API_KEY }} | |
PG_USERNAME: postgres | |
PG_PASSWORD: pinafore | |
SECRET_KEY_BASE: 00c33aa9929a0b2fdf6388368469a796fb3d812bee94349d5d9f3a81ecaf35e9195b7ad98bc3a42f27681dd2e6a9b56c589180842ef15630a775f68ccbc2dfc2 | |
TZ: UTC | |
DISABLE_SPRING: true | |
# Service containers to run with `runner-job` | |
services: | |
# Label used to access the service container | |
postgres: | |
# Docker Hub image | |
image: postgis/postgis:10-2.5 | |
# Provide the password for postgres | |
env: | |
POSTGRES_USER: postgres | |
PGUSER: postgres | |
POSTGRES_PASSWORD: pinafore | |
POSTGRES_DB: flood_risk_dummy_test | |
# Maps tcp port 5432 on service container to the host | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started. You must have this so the runner knows to wait till | |
# postgres is up and running before proceeding | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
# Downloads a copy of the code in your repository before running CI tests | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
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-version. This action supports reading the | |
# version from .ruby-version itself. | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Database migrations | |
run: | | |
RAILS_ENV=test bundle exec rails db:reset --trace | |
# 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 spec | |
sed -i 's@'$GITHUB_WORKSPACE'@/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 |