Skip to content

Final workflow

Final workflow #513

Workflow file for this run

name: build
on: [push, pull_request]
jobs:
build:
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: password
ports:
- 5432:5432
runs-on: ubuntu-latest
env:
DB_USER: postgres
DB_PASSWORD: password
RAILS_ENV: test
RUBY_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
CANVAS_URL: http://bcourses.test.instructure.com/
steps:
- uses: actions/checkout@v1
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
- name: Build and test with RSpec
run: |
gem install bundler
bundle install --jobs 4 --retry 3
rails db:create
rails db:migrate
bundle exec rspec
- name: Download and install Code Climate test reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- name: Run before-build command
run: ./cc-test-reporter before-build
- name: Run after-build command
run: |
./cc-test-reporter after-build --exit-code $?
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}