-
Notifications
You must be signed in to change notification settings - Fork 1
96 lines (85 loc) · 2.4 KB
/
verify.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
92
93
94
95
96
# This workflow runs the unit and system tests, as well as static code analysis
# and dependecy vulnerability checks.
#
# It uses the default MySQL database included in the runner (usually ubuntu-latest).
name: "Tests and code quality"
on:
push:
branches:
- "main"
- "release/sprint-*"
- "hotfix/*"
pull_request:
branches:
- "main"
- "release/sprint-*"
- "hotfix/*"
jobs:
linters:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-lint
cancel-in-progress: true
name: Linters
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby
uses: ruby/setup-ruby@v1
- name: Install gems
run: |
bundle install
- name: RuboCop
run: |
bundle exec rubocop --parallel
- name: Brakeman code scanning
run: |
bundle exec brakeman --format github --no-pager --no-exit-on-warn
- name: Bundler Audit check
run: |
bundle exec bundle audit check --update
tests:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-test
cancel-in-progress: true
name: Tests
runs-on: ubuntu-latest
env:
CI: true
DB_DATABASE: blacklight_test
DB_USER: root
DB_PASSWORD: root
RAILS_ENV: test
DATABASE_URL: "mysql2://root:root@localhost:3306/blacklight_test"
PATRONS_DB_URL: "mysql2://root:root@localhost:3306/blacklight_test"
REDIS_URL: redis://localhost:6379/0
services:
redis:
image: redis:alpine
ports:
- 6379:6379
options: --entrypoint redis-server
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby
uses: ruby/setup-ruby@v1
- name: Install gems
run: |
bundle install
- name: Set up MySQL
run: |
pwd
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
- name: RSpec tests
uses: coactions/setup-xvfb@v1.0.1
with:
run: |
bundle exec rspec
- name: Simplecov Report
uses: aki77/simplecov-report-action@v1
with:
failedThreshold: 80
token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.actor != 'dependabot[bot]' }}