-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.13 KB
/
main.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
name: Ruby
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- '3.1.4'
services:
mysql:
image: mysql
ports:
- 3306:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_DATABASE: ledger_test
postgres:
image: postgres:alpine
ports:
- 5432:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: ledger_test
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
# - name: Wait for MySQL
# run: |
# while ! mysqladmin ping -h"127.0.0.1" --silent; do
# sleep 1
# done
- name: Wait for PostgreSQL
run: |
until pg_isready -h 127.0.0.1 -d ledger_test; do
sleep 1
done
- name: Run the default task
run: bundle exec rake
# env:
# POSTGRES_HOST: 127.0.0.1
# MYSQL_HOST: 127.0.0.1