-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (74 loc) · 1.87 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
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
name: tests
on:
push:
branches:
- main
pull_request:
jobs:
build-sqlite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install dependencies
run: |
sudo apt-get install libsqlite3-dev -y
bundle install
- name: Run tests
run: |
bin/rails db:create db:test:prepare
bin/test
build-pg:
runs-on: ubuntu-latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
services:
postgres:
image: postgres:latest
ports:
- 5432:5432
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install dependencies
run: |
sudo apt-get -yqq install libpq-dev
bundle install
mv test/dummy/config/database.pg.yml test/dummy/config/database.yml
bin/rails db:create db:test:prepare
- name: Run tests
run: bin/test
build-mysql:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install dependencies
run: |
sudo service mysql start
sudo mysqladmin -proot password ''
mv test/dummy/config/database.trilogy.yml test/dummy/config/database.yml
bin/rails db:drop db:create db:migrate db:test:prepare
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
- name: Run tests
run: bin/test