forked from saasbook/flextensions
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.3 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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 }}