Merge pull request #7 from bigbrainenergy-org/feature/procedures #110
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: Test Suite | |
# Run against all commits and pull requests. | |
# on: [ push, pull_request ] | |
on: [ push ] | |
jobs: | |
specs: | |
runs-on: ubuntu-latest | |
# Add Postgres support | |
services: | |
postgres: | |
image: postgres:11 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--mount type=tmpfs,destination=/var/lib/postgresql/data | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
env: | |
CI: true | |
RAILS_ENV: test | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
SECRET_KEY_BASE: totally_secret_value_for_testing_56709_69420 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Postgres library | |
run: sudo apt-get install libpq-dev | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.1 | |
bundler-cache: true | |
- name: Setup test database | |
run: | | |
cp config/github_actions_database.yml config/database.yml | |
bundle exec rails db:setup | |
- name: Run tests | |
run: bundle exec rake spec | |
styling: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.1 | |
bundler-cache: true | |
- name: Run rubocop | |
run: bundle exec rake rubocop | |
security: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.1 | |
bundler-cache: true | |
- name: Run bundle audit | |
run: bundle exec bundle audit check --update | |
- name: Run brakeman | |
run: bundle exec brakeman | |
# TODO: Add documentation/maintainability testing? | |
finish: | |
runs-on: ubuntu-latest | |
needs: [ specs, styling, security ] | |
steps: | |
- name: Wait for status checks | |
run: echo "All Green!" |