Test BEFORE rename main branch to 6.x
#38
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: Greengage ABI Tests | |
| # Concurrency control to cancel previous runs on new push to same PR/branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true # Automatically cancel any previous runs for the same group | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: ['**'] | |
| env: | |
| # workaround required for checkout@v3, https://github.com/actions/checkout/issues/1590 | |
| ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | |
| jobs: | |
| abi-dump-setup: | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }} | |
| BASELINE_VERSION: ${{ steps.vars.outputs.BASELINE_VERSION }} | |
| ABI_LIBS: ${{ steps.vars.outputs.ABI_LIBS }} | |
| ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }} | |
| EXCEPTION_LISTS_COUNT: ${{ steps.check_exception_lists.outputs.EXCEPTION_LISTS_COUNT }} | |
| steps: | |
| - name: Fetch source | |
| uses: actions/checkout@v3 | |
| - name: Get Greengage version variables | |
| id: vars | |
| run: | | |
| remote_repo='https://github.com/GreengageDB/greengage.git' | |
| git ls-remote --tags --refs --sort='v:refname' $remote_repo '6.*' | tail -n 1 > baseline_version_ref | |
| baseline_ref=$(cat baseline_version_ref | awk '{print $1}') | |
| baseline_version=$(cat baseline_version_ref | awk '{print $2}') | |
| echo "BASELINE_REF=${baseline_ref}" | tee -a $GITHUB_OUTPUT | |
| echo "BASELINE_VERSION=${baseline_version#'refs/tags/'}" | tee -a $GITHUB_OUTPUT | |
| echo "ABI_LIBS=postgres" | tee -a $GITHUB_OUTPUT | |
| echo "ABI_HEADERS=." | tee -a $GITHUB_OUTPUT | |
| - name: Check if exception list exists | |
| id: check_exception_lists | |
| run: | | |
| exception_lists_count=$(ls .abi-check/${{ steps.vars.outputs.BASELINE_VERSION }}/ 2> /dev/null | wc -l) | |
| echo "EXCEPTION_LISTS_COUNT=${exception_lists_count}" | tee -a $GITHUB_OUTPUT | |
| - name: Upload symbol/type checking exception list | |
| if: steps.check_exception_lists.outputs.EXCEPTION_LISTS_COUNT != '0' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: exception_lists | |
| path: '.abi-check/${{ steps.vars.outputs.BASELINE_VERSION }}/' | |
| abi-dump: | |
| needs: abi-dump-setup | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| name: | |
| - build-baseline | |
| - build-latest | |
| include: | |
| - name: build-baseline | |
| repo: GreengageDB/greengage | |
| ref: ${{ needs.abi-dump-setup.outputs.BASELINE_VERSION }} | |
| - name: build-latest | |
| repo: ${{ github.repository }} | |
| ref: ${{ github.sha }} | |
| steps: | |
| - name: Download Greengage source code | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: ${{ matrix.repo }} | |
| ref: ${{ matrix.ref }} | |
| submodules: recursive | |
| fetch-depth: 0 # Specify '0' to fetch all history for all branches and tags. | |
| path: gpdb_src | |
| - name: Install dependencies and abi-dumper | |
| run: | | |
| sudo gpdb_src/README.ubuntu.bash | |
| sudo apt install -y libuv1-dev libpam0g-dev libldap-dev libipc-run-perl abi-dumper python-pip | |
| sudo ln -fs python2 /usr/bin/python | |
| sudo python -m pip install future | |
| - name: Build Greengage | |
| run: | | |
| ## TODO: Since abi-dumper requires debug info and it's hard to inject CFLAGS via the script for | |
| ## releasing Greengage, we have to manually configure it here. Probably we can improve it in future. | |
| pushd gpdb_src | |
| CC='gcc -m64' \ | |
| CFLAGS='-Og -g3 -gdwarf-4 -Wno-maybe-uninitialized' LDFLAGS='-Wl,--enable-new-dtags -Wl,--export-dynamic' \ | |
| ./configure --disable-gpperfmon --with-gssapi --enable-mapreduce --enable-orafce --enable-ic-proxy \ | |
| --enable-orca --with-libxml --with-pythonsrc-ext --with-uuid=e2fs --with-pgport=5432 --enable-tap-tests \ | |
| --enable-debug-extensions --with-perl --with-python --with-openssl --with-pam --with-ldap --with-includes="" \ | |
| --with-libraries="" --disable-rpath \ | |
| --prefix=/usr/local/greengage-db-devel \ | |
| --mandir=/usr/local/greengage-db-devel/man | |
| make -j`nproc` && sudo make install | |
| - name: Dump ABI | |
| run: | | |
| abi-dumper -lver ${{ matrix.ref }} -skip-cxx -public-headers /usr/local/greengage-db-devel/include/${{ needs.abi-dump-setup.outputs.ABI_HEADERS }} -o postgres-${{ matrix.ref }}.abi /usr/local/greengage-db-devel/bin/postgres | |
| - name: Upload ABI files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: '*${{ matrix.ref }}.abi' | |
| abi-compare: | |
| needs: | |
| - abi-dump-setup | |
| - abi-dump | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Download baseline | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-baseline | |
| path: build-baseline/ | |
| - name: Download latest | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-latest | |
| path: build-latest/ | |
| - name: Download exception lists | |
| if: needs.abi-dump-setup.outputs.EXCEPTION_LISTS_COUNT != '0' | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: exception_lists | |
| path: exception_lists/ | |
| - name: Install abi-compliance-checker and report viewer (lynx) | |
| run: | | |
| sudo apt install -y abi-compliance-checker lynx | |
| - name: Compare ABI | |
| run: | | |
| SKIP_POSTGRES_SYMBOLS_LIST="exception_lists/postgres.symbols.ignore" | |
| SKIP_POSTGRES_SYMBOLS_OPTION="" | |
| if [[ -f "$SKIP_POSTGRES_SYMBOLS_LIST" ]]; then | |
| SKIP_POSTGRES_SYMBOLS_OPTION="-skip-symbols ${SKIP_POSTGRES_SYMBOLS_LIST}" | |
| fi | |
| SKIP_POSTGRES_TYPES_LIST="exception_lists/postgres.types.ignore" | |
| SKIP_POSTGRES_TYPES_OPTION="" | |
| if [[ -f "$SKIP_POSTGRES_TYPES_LIST" ]]; then | |
| SKIP_POSTGRES_TYPES_OPTION="-skip-types ${SKIP_POSTGRES_TYPES_LIST}" | |
| fi | |
| abi-compliance-checker ${SKIP_POSTGRES_SYMBOLS_OPTION} \ | |
| ${SKIP_POSTGRES_TYPES_OPTION} \ | |
| -lib postgres \ | |
| -old build-baseline/postgres*.abi \ | |
| -new build-latest/postgres*.abi | |
| - name: Print out ABI report | |
| if: always() | |
| run: | | |
| lynx -dump $(find compat_reports/ | grep html) | |
| - name: Upload ABI Comparison | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: compat-report-${{ github.sha }} | |
| path: compat_reports/ |