Merge pull request #29 from MarcusAl/dependabot/bundler/pairings-api/… #71
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: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
scan_ruby: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: .ruby-version | |
bundler-cache: true | |
working-directory: ./pairings-api | |
- name: Scan for common Rails security vulnerabilities using static analysis | |
working-directory: ./pairings-api | |
run: bundle exec brakeman --no-pager | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: admin | |
POSTGRES_PASSWORD: 123 | |
POSTGRES_DB: pairings_api_test | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Install packages | |
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git pkg-config | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup CI Configuration | |
working-directory: ./pairings-api | |
run: bin/setup_ci | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: .ruby-version | |
bundler-cache: true | |
working-directory: ./pairings-api | |
- name: Run tests | |
env: | |
RAILS_ENV: test | |
DATABASE_USERNAME: admin | |
DATABASE_PASSWORD: 123 | |
DATABASE_HOST: localhost | |
DATABASE_PORT: 5432 | |
DATABASE_NAME: pairings_api_test | |
working-directory: ./pairings-api | |
run: | | |
bundle exec rails db:test:prepare | |
bundle exec rspec |