-
Notifications
You must be signed in to change notification settings - Fork 28
129 lines (114 loc) · 3.67 KB
/
smoke-test-packer.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Smoke Test packer template
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- main
env:
ORG: timescaledev
TS_VERSION: main
PLATFORM: linux/amd64
jobs:
smoketest-all:
name: PG${{ matrix.pg }}-${{ matrix.type }}-paacker
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pg: [15]
type: ['alpine', 'bitnami']
steps:
- name: Check out the source
uses: actions/checkout@v3
- name: Build packer template
run: |
cd packer
PACKER_LOG=1 packer init . && packer build -only 'warpsql.docker.${{matrix.type}}' -var image_repository=smoketest-image warpsql.pkr.hcl
- name: Install psql
run: sudo apt install postgresql-client
- name: Run the smoke test
run: |
set -eu
export PGHOST=localhost
export PGUSER=postgres
export PGPASSWORD=test1234
docker container stop smoketest-container || true
docker container rm smoketest-container || true
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=${PGPASSWORD} --name smoketest-container smoketest-image:latest
for _ in {1..120}
do
if [ -z "$(docker container ls -q --filter name=smoketest-container)" ]
then
echo "Smoketest container is not running"
exit 1
fi
if psql -c "select 1"
then
bash ./test/smoke_test/smoke_test.sh
break
fi
sleep 1
done
if ! psql -c "select 1"
then
echo "Cannot connect to PostgreSQL"
exit 1
fi
- name: Show the logs
if: always()
run: |
docker logs smoketest-container
smoketest-individual:
name: PG${{ matrix.pg }}-${{ matrix.type }}-${{matrix.extention}}-packer
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
pg: [15]
type: ['alpine', 'bitnami']
extention: ['timescaledb','pgvector','postgis','zombodb','pg_repack','pgautofailover','hll','citus']
steps:
- name: Check out the source
uses: actions/checkout@v3
- name: Build packer template
run: |
cd packer
PACKER_LOG=1 packer init . && packer build -only 'warpsql.docker.${{matrix.type}}' -var image_repository=smoketest-image -var extentions='${{matrix.extention}}' warpsql.pkr.hcl
- name: Install psql
run: sudo apt install postgresql-client
- name: Run the smoke test
run: |
set -eu
export PGHOST=localhost
export PGUSER=postgres
export PGPASSWORD=test1234
docker container stop smoketest-container || true
docker container rm smoketest-container || true
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=${PGPASSWORD} --name smoketest-container smoketest-image:latest
for _ in {1..120}
do
if [ -z "$(docker container ls -q --filter name=smoketest-container)" ]
then
echo "Smoketest container is not running"
exit 1
fi
if psql -c "select 1"
then
bash ./test/smoke_test/smoke_test.sh "${{matrix.extention}}"
break
fi
sleep 1
done
if ! psql -c "select 1"
then
echo "Cannot connect to PostgreSQL"
exit 1
fi
- name: Show the logs
if: always()
run: |
docker logs smoketest-container