-
Notifications
You must be signed in to change notification settings - Fork 6
104 lines (93 loc) · 2.54 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Continuous Integration
on:
push:
branches:
- "**"
tags:
- "v*.*.*"
pull_request:
branches:
- master
jobs:
rubocop:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["3.3"]
gemfile:
- "gemfiles/Gemfile.7.1.pg"
env:
BUNDLE_GEMFILE: ${{github.workspace}}/${{matrix.gemfile }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
- name: Bundle
run: bundle install
- name: Run Rubocop
run: bundle exec rubocop
tests:
runs-on: ubuntu-latest
services:
postgres:
image: ${{ endsWith(matrix.gemfile, '.pg') && 'postgres:16' || '' }}
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mysql:
image: ${{ endsWith(matrix.gemfile, '.mysql') && 'mysql:8' || '' }}
env:
MYSQL_ROOT_PASSWORD: password
ports: ["3306:3306"]
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
gemfile:
- "gemfiles/Gemfile.6.1.mysql"
- "gemfiles/Gemfile.6.1.pg"
- "gemfiles/Gemfile.7.0.mysql"
- "gemfiles/Gemfile.7.0.pg"
- "gemfiles/Gemfile.7.1.mysql"
- "gemfiles/Gemfile.7.1.pg"
- "gemfiles/Gemfile.7.2.mysql"
- "gemfiles/Gemfile.7.2.pg"
exclude:
- ruby: "3.0"
gemfile: "gemfiles/Gemfile.7.2.mysql"
- ruby: "3.0"
gemfile: "gemfiles/Gemfile.7.2.pg"
env:
BUNDLE_GEMFILE: ${{github.workspace}}/${{matrix.gemfile }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
- name: Bundle
run: bundle install
- name: Run Tests
env:
PGHOST: localhost
PGUSER: postgres
run: bundle exec rspec
publish:
needs:
- rubocop
- tests
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- uses: rubygems/release-gem@v1