-
Notifications
You must be signed in to change notification settings - Fork 488
67 lines (61 loc) · 2.25 KB
/
precheck.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
name: precheck
on:
push:
branches: [ POLARDB_15_STABLE ]
paths:
- '.github/workflows/precheck.yml'
- 'config/**'
- 'contrib/**'
- 'external/**'
- 'src/**'
- 'configure*'
- 'build.sh'
pull_request:
branches: [ POLARDB_15_STABLE ]
paths:
- '.github/workflows/precheck.yml'
- 'config/**'
- 'contrib/**'
- 'external/**'
- 'src/**'
- 'configure*'
- 'build.sh'
# trigger testing manually
workflow_dispatch:
jobs:
precheck:
runs-on: ubuntu-latest
strategy:
matrix:
container_image: [ ubuntu20.04, ubuntu22.04, anolis8, rocky8 ]
debug_mode: [ on, off ]
steps:
- name: fetch source code
uses: actions/checkout@v4
- name: create and start the container
run: |
docker create \
-t \
--name polardb_${{ matrix.container_image }} \
-v `pwd`:/home/postgres/PolarDB-for-PostgreSQL \
polardb/polardb_pg_devel:${{ matrix.container_image }} \
bash && \
docker start polardb_${{ matrix.container_image }}
- name: change ownership of the source code
run: |
docker exec \
polardb_${{ matrix.container_image }} \
bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \
sudo chown -R postgres:postgres ./"
- name: build and run precheck
run: |
docker exec \
polardb_${{ matrix.container_image }} \
bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \
if [ -f /etc/bashrc ]; then source /etc/bashrc; fi && \
cpu_count=$(nproc) && \
./build.sh --debug=${{ matrix.debug_mode }} --jobs=$cpu_count --ec='--enable-tap-tests' && \
make precheck"
- name: change ownership of the source code back
run: |
sudo chown -R runner:runner `pwd`