From 885c166eb66e80df1e66ecb37cb4b5f6c56ff91c Mon Sep 17 00:00:00 2001 From: mrdrivingduck Date: Tue, 3 Sep 2024 18:21:17 +0800 Subject: [PATCH] ci: support precheck for v15 --- .github/ISSUE_TEMPLATE/bug_report.md | 30 +++++++++++++ .github/ISSUE_TEMPLATE/question.md | 12 +++++ .github/workflows/precheck.yml | 67 ++++++++++++++++++++++++++++ .github/workflows/sync-postgres.yml | 42 +++++++++++++++++ GNUmakefile.in | 2 +- external/polar_worker/Makefile | 1 + 6 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/question.md create mode 100644 .github/workflows/precheck.yml create mode 100644 .github/workflows/sync-postgres.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000000..3a89c17ecfb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,30 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[Bug]" +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. xxx +2. xxx +3. xxx + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment (please complete the following information):** + - OS: [e.g. CentOS 7] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 00000000000..f223c068ca0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,12 @@ +--- +name: Question +about: Ask question about anything here. +title: "[Question]" +labels: question +assignees: '' + +--- + +**Describe the problem** + +... diff --git a/.github/workflows/precheck.yml b/.github/workflows/precheck.yml new file mode 100644 index 00000000000..54a1e94573f --- /dev/null +++ b/.github/workflows/precheck.yml @@ -0,0 +1,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 --ws=1 --wr=2 --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` diff --git a/.github/workflows/sync-postgres.yml b/.github/workflows/sync-postgres.yml new file mode 100644 index 00000000000..d56e3132af8 --- /dev/null +++ b/.github/workflows/sync-postgres.yml @@ -0,0 +1,42 @@ +name: sync with postgres upstream + +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * *" + +jobs: + repo-sync: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: repo-sync-master + uses: repo-sync/github-sync@v2 + with: + source_repo: https://github.com/postgres/postgres.git + source_branch: master + destination_branch: master + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: repo-sync-17 + uses: repo-sync/github-sync@v2 + with: + source_repo: https://github.com/postgres/postgres.git + source_branch: REL_17_STABLE + destination_branch: REL_17_STABLE + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: repo-sync-16 + uses: repo-sync/github-sync@v2 + with: + source_repo: https://github.com/postgres/postgres.git + source_branch: REL_16_STABLE + destination_branch: REL_16_STABLE + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: repo-sync-15 + uses: repo-sync/github-sync@v2 + with: + source_repo: https://github.com/postgres/postgres.git + source_branch: REL_15_STABLE + destination_branch: REL_15_STABLE + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/GNUmakefile.in b/GNUmakefile.in index 8cb6362cdce..4d51d1a6261 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -157,7 +157,7 @@ cpluspluscheck: submake-generated-headers # POLAR # LAST_COMMIT = HEAD~1 -PROVE_FLAGS = "--timer -j4" +PROVE_FLAGS = "--timer" precheck-main: | temp-install $(MAKE) check-world EXTRA_TESTS=numeric_big PG_TEST_EXTRA='kerberos ldap ssl' USE_MODULE_DB=1 PROVE_FLAGS=$(PROVE_FLAGS) diff --git a/external/polar_worker/Makefile b/external/polar_worker/Makefile index 749a377f3d3..8bd06d60847 100644 --- a/external/polar_worker/Makefile +++ b/external/polar_worker/Makefile @@ -8,6 +8,7 @@ DATA = polar_worker--1.0.sql REGRESS = polar_worker TEMP_CONFIG = polar_worker.conf +PG_CPPFLAGS = -Wno-error=unused-result LDFLAGS_SL += $(filter -lm, $(LIBS)) ifdef USE_PGXS