Include Postgres header in coccinelle (#9884) #36453
This file contains hidden or 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: Update and Downgrade | |
| "on": | |
| push: | |
| branches: | |
| - main | |
| - ?.*.x | |
| - prerelease_test | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| check_paths: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| run_ci: >- | |
| ${{ github.event_name == 'push' | |
| || (steps.filter.outputs.src == 'true' && !contains(github.event.pull_request.labels.*.name, 'skip-ci')) | |
| }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | |
| id: filter | |
| with: | |
| filters: .github/filters.yaml | |
| update_test: | |
| needs: check_paths | |
| if: needs.check_paths.outputs.run_ci == 'true' | |
| name: Update test PG${{ matrix.pg }} | |
| runs-on: 'ubuntu-latest' | |
| strategy: | |
| matrix: | |
| pg: [15, 16, 17, 18] | |
| fail-fast: false | |
| env: | |
| PG_VERSION: ${{ matrix.pg }} | |
| POSTGRES_HOST_AUTH_METHOD: trust | |
| steps: | |
| - name: Checkout TimescaleDB | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install Linux Dependencies | |
| timeout-minutes: 15 | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install gnupg systemd-coredump gdb postgresql-common libkrb5-dev | |
| yes | sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh | |
| echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -c -s) main" | sudo tee /etc/apt/sources.list.d/timescaledb.list | |
| wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - | |
| sudo apt-get update | |
| sudo apt-get install postgresql-${{ matrix.pg }} postgresql-server-dev-${{ matrix.pg }} | |
| sudo apt-get install -y --no-install-recommends timescaledb-2-postgresql-${{ matrix.pg }} | |
| git fetch --tags | |
| - name: Update tests PG${{ matrix.pg }} | |
| run: | | |
| PATH="/usr/lib/postgresql/${{ matrix.pg }}/bin:$PATH" | |
| ./scripts/test_updates.sh | |
| - name: Downgrade tests PG${{ matrix.pg }} | |
| if: always() | |
| run: | | |
| PATH="/usr/lib/postgresql/${{ matrix.pg }}/bin:$PATH" | |
| ./scripts/test_downgrade.sh | |
| - name: Update diff | |
| if: failure() | |
| run: | | |
| find update_test -name "*.diff" -print0 | xargs -0 -IFILE sh -c "echo '\nFILE\n';cat FILE" | |
| - name: Postgres Errors | |
| if: failure() | |
| run: | | |
| find update_test -name postgres.log -exec grep ERROR {} \; | |
| - name: Check for coredumps | |
| if: failure() | |
| id: collectlogs | |
| run: | | |
| # wait for in progress coredumps | |
| sleep 10 | |
| if coredumpctl list; then | |
| echo "coredumps=true" >>$GITHUB_OUTPUT | |
| false | |
| fi | |
| - name: Stack trace | |
| if: always() && steps.collectlogs.outputs.coredumps == 'true' | |
| run: | | |
| sudo coredumpctl gdb <<<" | |
| set verbose on | |
| set trace-commands on | |
| show debug-file-directory | |
| printf "'"'"query = '%s'\n\n"'"'", (char *) debug_query_string | |
| frame function ExceptionalCondition | |
| printf "'"'"condition = '%s'\n"'"'", (char *) conditionName | |
| up 1 | |
| l | |
| info args | |
| info locals | |
| bt full | |
| " 2>&1 | tee stacktrace.log | |
| ./scripts/bundle_coredumps.sh | |
| false | |
| - name: Upload Coredumps | |
| if: always() && steps.collectlogs.outputs.coredumps == 'true' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: Coredumps update-test PG${{ matrix.pg }} | |
| path: coredumps | |
| - name: Upload Artifacts | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: Update test PG${{ matrix.pg }} | |
| path: update_test | |
| report_status: | |
| name: Update and Downgrade summary | |
| needs: [check_paths, update_test] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: | | |
| # If the detector failed, or the matrix failed, exit with error | |
| if [[ "${{ needs.update_test.result }}" == "failure" ]]; then | |
| exit 1 | |
| fi | |
| echo "All checks passed or were safely skipped." | |