-
Notifications
You must be signed in to change notification settings - Fork 8
91 lines (83 loc) · 2.44 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
87
88
89
90
91
name: "Ruby on Rails CI"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
name: rspec
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: fauna_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby-3.1.3
bundler-cache: true
- name: Install PostgreSQL
run: sudo apt-get -yqq install libpq-dev
# - name: Run yarn commands
# run: |
# yarn install
# yarn build
# yarn build:css
- name: Configure Database
run: cp config/database.yml.ci config/database.yml
- name: Setup Database
env:
RAILS_ENV: test
run: bundle exec bin/rails db:schema:load
- name: Set up GPG
env:
GNUPGHOME: tmp/fauna_fake_gpg_home
run: mkdir tmp/fauna_fake_gpg_home && gpg -K && gpg --gen-key --batch spec/support/test_gpg_key_generation.batch
- name: Set up test user
env:
RAILS_ENV: test
GNUPGHOME: tmp/fauna_fake_gpg_home
run: bundle exec bin/setup -u admin -e [email protected] -n admin -p foobarbaz
- name: Build and test with rspec
env:
GNUPGHOME: tmp/fauna_fake_gpg_home
RAILS_ENV: test
run: bundle exec rspec
- name: Archive test failure screenshots
uses: actions/upload-artifact@v3
if: always()
with:
name: screenshots
path: tmp/capybara
- name: Archive detailed Simplecov Report
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage/index.html
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby-3.1.3
bundler-cache: true
# Add or replace any other lints here
- name: Security audit dependencies
run: bundle exec bundler-audit --update
- name: Security audit application code
run: bundle exec brakeman -q -w2
- name: Lint Ruby files
run: bundle exec standardrb --parallel