-
Notifications
You must be signed in to change notification settings - Fork 2
110 lines (86 loc) · 2.77 KB
/
ci.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
97
98
99
100
101
102
103
104
105
106
107
108
109
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
standard_ruby:
if: github.actor != 'github-actions[bot]' && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
checks: write
contents: write
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Ruby
uses: ruby/[email protected]
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Run Standard Ruby
uses: standardrb/standard-ruby-action@v1
scan_ruby:
if: github.actor != 'github-actions[bot]' && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Ruby
uses: ruby/[email protected]
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Scan for common Rails security vulnerabilities using static analysis
run: bin/brakeman --no-pager
scan_js:
if: github.actor != 'github-actions[bot]' && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Setup node
uses: actions/[email protected]
with:
node-version: 20
- name: setup yarn
run: npm install --global yarn
- name: Scan for security vulnerabilities in JavaScript dependencies
run: yarn install --frozen-lockfile && yarn audit --level high
test:
if: github.actor != 'github-actions[bot]' && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Install packages
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libjemalloc2 libvips sqlite3
- name: Checkout code
uses: actions/[email protected]
- name: Set up Ruby
uses: ruby/[email protected]
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Setup node
uses: actions/[email protected]
with:
node-version: 20
- name: setup yarn
run: npm install --global yarn
- name: Set up JavaScript dependencies
run: yarn install --frozen-lockfile
- name: Prepare db
env:
RAILS_ENV: test
run: bin/rails db:test:prepare
- name: Run tests
env:
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: bundle exec rspec
- name: Keep screenshots from failed system tests
uses: actions/[email protected]
if: failure()
with:
name: screenshots
path: ${{ github.workspace }}/tmp/screenshots
if-no-files-found: ignore