ci: support precheck for v15 #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 && \ | |
./build.sh --debug=${{ matrix.debug_mode }} --ec='--enable-tap-tests' && \ | |
make precheck" | |
- name: change ownership of the source code back | |
run: | | |
sudo chown -R runner:runner `pwd` |