1+ name : PG Docker Testing
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ pg-version :
7+ description : pg version for docker image
8+ required : true
9+ default : ' 15.14'
10+ type : choice
11+ options :
12+ - ' 17.6'
13+ - ' 16.10'
14+ - ' 15.14'
15+ - ' 14.19'
16+ - ' 13.22'
17+
18+ arch :
19+ description : architecture
20+ required : true
21+ default : amd64
22+ type : choice
23+ options :
24+ - amd64
25+ - arm64
26+
27+ jobs :
28+ test-image :
29+ runs-on : ubuntu-latest
30+
31+ steps :
32+ - name : Get PG major version
33+ run : |
34+ PG_MAJOR=$(echo "${{ inputs.pg-version }}" | cut -d'.' -f1)
35+ echo "PG_MAJOR="$PG_MAJOR"" >> $GITHUB_ENV
36+ shell : bash
37+
38+ - name : Pull Percona-PostgreSQL image
39+ run : |
40+ docker pull perconalab/percona-distribution-postgresql:${{ inputs.pg-version }}-1-${{ inputs.arch }}
41+
42+ - name : Run AMD container
43+ if : ${{ contains(inputs.arch, 'amd64') }}
44+ run : |
45+ docker run --name ppg-test -e POSTGRES_PASSWORD=secret -d perconalab/percona-distribution-postgresql:${{ inputs.pg-version }}-1-${{ inputs.arch }}
46+
47+ - name : Prep for ARM container
48+ if : ${{ contains(inputs.arch, 'arm64') }}
49+ run : |
50+ docker run --rm --privileged tonistiigi/binfmt --install all
51+ docker run --rm --platform linux/arm64 alpine uname -m
52+
53+ - name : Run ARM container
54+ if : ${{ contains(inputs.arch, 'arm64') }}
55+ run : |
56+ docker run --platform linux/arm64 --name ppg-test -e POSTGRES_PASSWORD=secret -d perconalab/percona-distribution-postgresql:${{ inputs.pg-version }}-1-${{ inputs.arch }}
57+
58+ - name : Wait for PostgreSQL to start
59+ run : sleep 15
60+
61+ - name : Verify container is running
62+ run : |
63+ docker ps --filter "name=ppg-test" --format "table {{.Names}}\t{{.Status}}"
64+ if [ "$(docker inspect -f '{{.State.Running}}' ppg-test)" != "true" ]; then
65+ echo "Container is not running!" && exit 1
66+ fi
67+
68+ - name : Check PostgreSQL version
69+ run : |
70+ docker exec ppg-test psql -U postgres -c "SELECT version();"
71+
72+ - name : Verify required packages and versions
73+ run : |
74+ REQUIRED_PACKAGES=(
75+ percona-postgresql${{ env.PG_MAJOR }}
76+ percona-postgresql${{ env.PG_MAJOR }}-contrib
77+ percona-postgresql${{ env.PG_MAJOR }}-server
78+ percona-postgresql${{ env.PG_MAJOR }}-libs
79+ percona-postgresql-common
80+ percona-postgresql-client-common
81+ percona-pg_stat_monitor${{ env.PG_MAJOR }}
82+ percona-pg_repack${{ env.PG_MAJOR }}
83+ percona-pgaudit${{ env.PG_MAJOR }}
84+ percona-pgaudit${{ env.PG_MAJOR }}_set_user
85+ percona-pgbackrest
86+ percona-pgvector_${{ env.PG_MAJOR }}
87+ percona-wal2json${{ env.PG_MAJOR }}
88+ )
89+
90+ echo "Checking required packages..."
91+ for pkg in "${REQUIRED_PACKAGES[@]}"; do
92+ echo "----- $pkg -----"
93+ docker exec ppg-test rpm -qi $pkg | grep ^Version || echo "$pkg not installed!"
94+ done
95+
96+ - name : Clean Up
97+ if : always()
98+ run : |
99+ docker stop ppg-test || true
100+ docker rm ppg-test || true
0 commit comments