75 lines (72 loc) · 2.13 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
name: test
on:
push:
paths-ignore:
- .gitignore
- CHANGELOG.md
- README.md
pull_request:
paths-ignore:
- .gitignore
- CHANGELOG.md
- README.md
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- "2.7.6"
- "3.0.4"
- "3.1.2"
- "3.2.2"
env:
- MYSQL57=1
- MYSQL80=1
- POSTGRESQL=1
gemfile:
- gemfiles/activerecord_6.1.gemfile
- gemfiles/activerecord_7.0.gemfile
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Setup dependencies
run: |
for i in {1..60}; do docker-compose up -d && break; sleep 1; done
# Wait until database servers start
function mysql57_ping { mysqladmin -u root -h 127.0.0.1 -P 13316 ping; }
function mysql80_ping { mysqladmin -u root -h 127.0.0.1 -P 13318 ping; }
function pg_ping { PGPASSWORD=password pg_isready -U postgres -h 127.0.0.1 -p 15442; }
for i in {1..60}; do mysql57_ping && break; sleep 1; done
for i in {1..60}; do mysql80_ping && break; sleep 1; done
for i in {1..60}; do pg_ping && break; sleep 1; done
env:
MYSQL_PWD: password
- name: Run tests
run: ${{ matrix.env }} bundle exec rake
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
- name: Coveralls Parallel
uses: coverallsapp/github-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.ruby }}-${{ matrix.env }}-${{ matrix.gemfile }}
parallel: true
finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true