-
Notifications
You must be signed in to change notification settings - Fork 9
47 lines (45 loc) · 1.26 KB
/
test.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
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- run: bundle exec rake rubocop
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ["2.7", "3.0", "3.1", "3.2"]
database_url:
- "sqlite3:///tmp/test.sqlite3"
- "mysql2://root:root@localhost/runner"
- "postgres://runner@localhost/runner"
env:
DATABASE_URL: ${{ matrix.database_url }}
RACK_ENV: test
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- run: |
sudo systemctl start mysql.service
mysqladmin ping -h localhost -u root -proot
mysql -h localhost -u root -proot -e "CREATE DATABASE runner;"
- run: |
sudo systemctl start postgresql.service
pg_isready
sudo PGPASSWORD=runner -u postgres createuser -s -d -r runner
sudo -u postgres createdb -O runner runner
- run: |
bundle exec rake spec