-
Notifications
You must be signed in to change notification settings - Fork 19
73 lines (59 loc) · 1.59 KB
/
ci.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
name: CI
on:
push:
pull_request:
workflow_dispatch:
# schedule:
# - cron: '42 5 * * *'
jobs:
test-in-container:
strategy:
fail-fast: false
matrix:
ruby: [ '3.1.2' ]
database:
- 'pg16.2-ts2.14.2-all'
- 'pg15.6-ts2.14.2-all'
- 'pg14.11-ts2.14.2-all'
services:
database:
image: timescale/timescaledb-ha:${{matrix.database}}
env:
POSTGRES_USER: username
POSTGRES_PASSWORD: secret
POSTGRES_DB: testdb
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
name: OS Ruby ${{matrix.ruby}} database ${{matrix.database}}
container: ruby:${{matrix.ruby}}
steps:
- uses: actions/checkout@v3
- name: Show Ruby Version
run: |
ruby -v
- name: Install psql
run: |
apt-get update
apt-get install -y postgresql-client
- name: Show PostgreSQL version and time
env:
PGPASSWORD: secret
run: |
echo "SELECT version()" | psql -h database -U username testdb
echo "SELECT CURRENT_TIME" | psql -h database -U username testdb
- name: Setup
run: |
./bin/setup
- name: run tsdb
run: ./bin/tsdb postgres://username:secret@database:5432/testdb --stats
- name: Test setup
run: |
echo PG_URI_TEST="postgres://username:secret@database:5432/testdb" > .env
cat .env
bundle exec rake test:setup
- name: Test
run: bundle exec rake