-
Notifications
You must be signed in to change notification settings - Fork 5
76 lines (70 loc) · 1.87 KB
/
build.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
name: Build
on:
push:
pull_request:
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ["3.0", "3.1", "3.2"]
database:
- sqlite
- postgresql
- mysql
gemfile:
- Gemfile
- spec/ci/rails70.gemfile
- spec/ci/rails61.gemfile
services:
postgresql:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports: ["3306:3306"]
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
DB: ${{ matrix.database }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Prepare database
env:
PGPASSWORD: postgres
run: |
bundle exec rake db:drop
bundle exec rake db:create
- name: Run tests
run: bundle exec rake
- name: Report to coveralls
if: |
github.repository == 'joshwlewis/validates_by_schema' &&
matrix.gemfile == 'Gemfile' &&
matrix.ruby-version == '3.2' &&
matrix.database == 'postgresql'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./coverage/lcov.info"