forked from saasbook/berkeley-reentry-student-program
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.75 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: build
on:
- push
- pull_request
- workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
env:
CCTR: ./cc-test-reporter
BUNDLE_WITHOUT: production
TZ: America/Los_Angeles
steps:
- uses: actions/checkout@v1
- name: Install Ruby (3.0)
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.3
bundler-cache: true
- name: Set up 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
./cc-test-reporter before-build
- name: Install bundler
run: |
gem install bundler
- name: Install dependencies
run: |
bundle install
- name: Set up PostgreSQL
run: |
sudo apt-get install postgresql libpq-dev
sudo service postgresql start
sudo -u postgres createuser --superuser "$USER"
- name: setup the database
run: |
bundle exec rake db:create db:migrate
- name: run Cucumber tests #and capture coverage
run: |
bundle exec cucumber
./cc-test-reporter format-coverage --output coverage/codeclimate.$SUITE.json --input-type simplecov
- name: run RSpec tests #and capture coverage
run: |
bundle exec rspec
./cc-test-reporter format-coverage --output coverage/codeclimate.$SUITE.json --input-type simplecov
- name: Publish code coverage
run: |
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
./cc-test-reporter sum-coverage coverage/codeclimate.*.json
./cc-test-reporter upload-coverage --id ${{ secrets.CC_TEST_REPORTER_ID }}
./cc-test-reporter after-build --id ${{ secrets.CC_TEST_REPORTER_ID }}