-
Notifications
You must be signed in to change notification settings - Fork 141
71 lines (63 loc) · 1.71 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
name: CI
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
scan_ruby:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Scan for common Rails security vulnerabilities using static analysis
run: bin/brakeman --no-pager
test_lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
database_adapter:
- postgresql
- sqlite
env:
DB_ADAPTER: ${{ matrix.database_adapter }}
DB_USERNAME: postgres
DB_PASSWORD: postgres
services:
postgres:
image: postgres:latest
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 3
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- name: Test and Lint
run: |
sudo apt-get update
sudo apt-get -yqq install libpq-dev libvips ffmpeg
bundle exec rails db:setup
bundle exec rails lint:all
bundle exec rails test:all
- name: Push coverage data to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}