-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (85 loc) · 2.75 KB
/
rspec.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: RSpec
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
# Also trigger on page_build, as well as release created events
page_build:
release:
types: # This configuration does not affect the page_build event above
- created
jobs:
rspec:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '16' ]
ruby: [2.7.4] # note, must use '3.0' with quotes due to known bug
services:
postgres:
image: postgres:12
ports: ["5432:5432"]
env:
RAILS_ENV: test
POSTGRES_PASSWORD: password
PG_HOST: /var/run/postgresql
PG_USER: SoloAsana
PG_PASSWORD: password
PG_PORT: 5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- run: npm install
- name: Install Chromedriver
uses: nanasess/setup-chromedriver@master
- name: 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
./cc-test-reporter before-build
- name: Run RSpec with Chromedriver and System Specs
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
DATABASE_URL: postgres://postgres:@localhost:5432/SoloAsana_test
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
POSTGRES_PASSWORD: password
PG_HOST: /var/run/postgresql
PG_USER: SoloAsana
PG_PASSWORD: password
PG_PORT: 5432
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
sudo apt-get -yqq install libpq-dev
bundle exec rails db:setup
bundle exec rspec
- name: Publish Coverage Report to CodeClimate
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
uses: paambaati/[email protected]
with:
debug: true
coverageLocations: |
${{github.workspace}}/*.resultset.json:simplecov