Skip to content

Commit 0ed1f33

Browse files
authored
Merge pull request #98 from cosmo0920/add-github-actions
Add GitHub Actions for CI
2 parents 39fdf98 + ddb5171 commit 0ed1f33

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/linux.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: linux
2+
on:
3+
- push
4+
- pull_request
5+
6+
jobs:
7+
build:
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
ruby: [ '2.4', '2.5', '2.6', '2.7' ]
13+
postgres: [ '9', '10', '11', '12', '13' ]
14+
os:
15+
- ubuntu-latest
16+
services:
17+
postgres:
18+
image: postgres:${{ matrix.postgres }}
19+
ports:
20+
- 5432:5432
21+
env:
22+
POSTGRES_USER: postgres
23+
POSTGRES_PASSWORD: password
24+
POSTGRES_DB: test
25+
options: >-
26+
--health-cmd pg_isready
27+
--health-interval 10s
28+
--health-timeout 5s
29+
--health-retries 5
30+
name: Ruby ${{ matrix.ruby }} with PostgreSQL ${{ matrix.postgres }} unit testing on ${{ matrix.os }}
31+
steps:
32+
- uses: actions/checkout@v2
33+
- uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: ${{ matrix.ruby }}
36+
- name: prepare database
37+
env:
38+
PGPASSWORD: password
39+
run: |
40+
psql -h localhost -p 5432 -U postgres -c "CREATE ROLE fluentd WITH LOGIN ENCRYPTED PASSWORD 'fluentd';"
41+
psql -h localhost -p 5432 -U postgres -c "CREATE DATABASE fluentd_test OWNER fluentd;"
42+
- name: unit testing
43+
run: |
44+
gem install bundler rake
45+
bundle install --jobs 4 --retry 3
46+
bundle exec rake test

0 commit comments

Comments
 (0)