-
-
Notifications
You must be signed in to change notification settings - Fork 79
69 lines (64 loc) · 1.64 KB
/
ci.yml
File metadata and controls
69 lines (64 loc) · 1.64 KB
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
name: CI
on:
pull_request:
push:
branches: [ main ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby-3.3.0
bundler-cache: true
- name: Lint code for consistent style
run: bin/rubocop -f github
test:
runs-on: ubuntu-latest
env:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
CI: true
strategy:
fail-fast: false
matrix:
ruby: ["3.4"]
gemfile: [
"gemfiles/rails8.gemfile",
]
include:
- ruby: "3.4"
gemfile: "gemfiles/railsmain.gemfile"
- ruby: "3.3"
gemfile: "gemfiles/rails8.gemfile"
- ruby: "3.2"
gemfile: "gemfiles/rails7.gemfile"
steps:
- uses: actions/checkout@v5
- name: Install system deps
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Setup database
env:
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
run: |
cd test/dummy
bundle exec rails db:create
bundle exec rails db:migrate
cd ../..
- name: Run tests
env:
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: bin/test