-
-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (73 loc) · 2.03 KB
/
test.yml
File metadata and controls
81 lines (73 loc) · 2.03 KB
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
---
name: ruby-tests
on:
pull_request_target:
push:
branches:
- main
workflow_dispatch:
inputs: {}
jobs:
build:
name: Tests with Ruby ${{ matrix.ruby }} and ${{ matrix.gemfile }}
runs-on: "ubuntu-latest"
if: |
github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target' ||
github.actor != 'dependabot[bot]'
strategy:
fail-fast: false
matrix:
ruby: ["3.2", "3.3"]
gemfile:
- Gemfile
services:
postgres:
image: postgres
env:
POSTGRES_DB: test
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
--health-retries 5
ports:
- 5432:5432
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: test
MYSQL_PASSWORD: test
MYSQL_DATABASE: test
MYSQL_USER: test
ports:
- 3306:3306
options:
--health-cmd="mysqladmin ping" --health-interval=10s
--health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: vendor/bundle
key: >
${{ runner.os }}-${{ matrix.ruby }}-gems-${{
hashFiles(matrix.gemfile) }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install gem dependencies
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
run: |
gem install bundler
bundle config path vendor/bundle
bundle update --jobs 4 --retry 3
- name: Run Tests
env:
PGHOST: localhost
PGUSER: postgres
PG_DATABASE_URL: "postgres://127.0.0.1/test?application_name=sql_runner"
MYSQL_DATABASE_URL: "mysql2://test:test@127.0.0.1/test?application_name=sql_runner"
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
run: |
bundle exec rake