|
| 1 | +name: Greenplum ABI Tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + paths: |
| 7 | + - 'concourse/scripts/**' |
| 8 | + - 'src/**' |
| 9 | + - '.github/workflows/**' |
| 10 | + - '.github/scripts/**' |
| 11 | + - '.abi-check/**' |
| 12 | + |
| 13 | + push: |
| 14 | + branches: |
| 15 | + - main |
| 16 | + paths: |
| 17 | + - 'concourse/scripts/**' |
| 18 | + - 'src/**' |
| 19 | + - '.github/workflows/**' |
| 20 | + - '.github/scripts/**' |
| 21 | + - '.abi-check/**' |
| 22 | + |
| 23 | +jobs: |
| 24 | + abi-dump-setup: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + outputs: |
| 27 | + BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }} |
| 28 | + BASELINE_VERSION: ${{ steps.vars.outputs.BASELINE_VERSION }} |
| 29 | + ABI_LIBS: ${{ steps.vars.outputs.ABI_LIBS }} |
| 30 | + ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }} |
| 31 | + EXCEPTION_LISTS_COUNT: ${{ steps.check_exception_lists.outputs.EXCEPTION_LISTS_COUNT }} |
| 32 | + steps: |
| 33 | + - name: Fetch source |
| 34 | + uses: actions/checkout@v3 |
| 35 | + |
| 36 | + - name: Get Greenplum version variables |
| 37 | + id: vars |
| 38 | + run: | |
| 39 | + remote_repo='https://github.com/greenplum-db/gpdb.git' |
| 40 | + git ls-remote --tags --refs --sort='v:refname' $remote_repo '7.*' | grep -v '-' | tail -n 1 > baseline_version_ref |
| 41 | + baseline_ref=$(cat baseline_version_ref | awk '{print $1}') |
| 42 | + baseline_version=$(cat baseline_version_ref | awk '{print $2}') |
| 43 | + echo "BASELINE_REF=${baseline_ref}" | tee -a $GITHUB_OUTPUT |
| 44 | + echo "BASELINE_VERSION=${baseline_version#'refs/tags/'}" | tee -a $GITHUB_OUTPUT |
| 45 | + echo "ABI_LIBS=postgres" | tee -a $GITHUB_OUTPUT |
| 46 | + echo "ABI_HEADERS=." | tee -a $GITHUB_OUTPUT |
| 47 | +
|
| 48 | + - name: Check if exception list exists |
| 49 | + id: check_exception_lists |
| 50 | + run: | |
| 51 | + exception_lists_count=$(ls .abi-check/${{ steps.vars.outputs.BASELINE_VERSION }}/ 2> /dev/null | wc -l) |
| 52 | + echo "EXCEPTION_LISTS_COUNT=${exception_lists_count}" | tee -a $GITHUB_OUTPUT |
| 53 | +
|
| 54 | + - name: Upload symbol/type checking exception list |
| 55 | + if: steps.check_exception_lists.outputs.EXCEPTION_LISTS_COUNT != '0' |
| 56 | + uses: actions/upload-artifact@v3 |
| 57 | + with: |
| 58 | + name: exception_lists |
| 59 | + path: '.abi-check/${{ steps.vars.outputs.BASELINE_VERSION }}/' |
| 60 | + |
| 61 | + abi-dump: |
| 62 | + needs: abi-dump-setup |
| 63 | + runs-on: ubuntu-latest |
| 64 | + container: gcr.io/data-gpdb-public-images/gpdb7-rocky8-build |
| 65 | + strategy: |
| 66 | + matrix: |
| 67 | + name: |
| 68 | + - build-baseline |
| 69 | + - build-latest |
| 70 | + include: |
| 71 | + - name: build-baseline |
| 72 | + repo: greenplum-db/gpdb |
| 73 | + ref: ${{ needs.abi-dump-setup.outputs.BASELINE_VERSION }} |
| 74 | + - name: build-latest |
| 75 | + repo: ${{ github.repository }} |
| 76 | + ref: ${{ github.sha }} |
| 77 | + |
| 78 | + steps: |
| 79 | + ## FIXME: abi-dumper requires 'Universal Ctags' but the package manager only provides |
| 80 | + ## 'Exuberant Ctags'. |
| 81 | + - name: Install universal-ctags. |
| 82 | + run: | |
| 83 | + wget 'https://github.com/universal-ctags/ctags-nightly-build/releases/download/2023.07.05%2Bafdae39c0c2e508d113cbc570f4635b96159840c/uctags-2023.07.05-linux-x86_64.tar.xz' |
| 84 | + tar -xf uctags-2023.07.05-linux-x86_64.tar.xz |
| 85 | + cp uctags-2023.07.05-linux-x86_64/bin/* /usr/bin/ |
| 86 | + which ctags |
| 87 | +
|
| 88 | + - name: Download Greenplum source code |
| 89 | + uses: actions/checkout@v3 |
| 90 | + with: |
| 91 | + repository: ${{ matrix.repo }} |
| 92 | + ref: ${{ matrix.ref }} |
| 93 | + submodules: recursive |
| 94 | + fetch-depth: 0 # Specify '0' to fetch all history for all branches and tags. |
| 95 | + path: gpdb_src |
| 96 | + |
| 97 | + - name: Install abi-dumper |
| 98 | + run: | |
| 99 | + yum install -y epel-release |
| 100 | + yum install -y abi-dumper |
| 101 | +
|
| 102 | + - name: Build Greenplum |
| 103 | + run: | |
| 104 | + ## TODO: Since abi-dumper requires debug info and it's hard to inject CFLAGS via the script for |
| 105 | + ## releasing Greenplum, we have to manually configure it here. Probably we can improve it in future. |
| 106 | + pushd gpdb_src |
| 107 | + CC='gcc -m64' \ |
| 108 | + CFLAGS='-Og -g3 -Wno-maybe-uninitialized' LDFLAGS='-Wl,--enable-new-dtags -Wl,--export-dynamic' \ |
| 109 | + ./configure --with-quicklz --disable-gpperfmon --with-gssapi --enable-mapreduce --enable-orafce --enable-ic-proxy \ |
| 110 | + --enable-orca --with-libxml --with-pythonsrc-ext --with-uuid=e2fs --with-pgport=5432 --enable-tap-tests \ |
| 111 | + --enable-debug-extensions --with-perl --with-python --with-openssl --with-pam --with-ldap --with-includes="" \ |
| 112 | + --with-libraries="" --disable-rpath \ |
| 113 | + --prefix=/usr/local/greenplum-db-devel \ |
| 114 | + --mandir=/usr/local/greenplum-db-devel/man |
| 115 | + make -j`nproc` && make install |
| 116 | +
|
| 117 | + - name: Dump ABI |
| 118 | + run: | |
| 119 | + abi-dumper -lver ${{ matrix.ref }} -skip-cxx -public-headers /usr/local/greenplum-db-devel/include/${{ needs.abi-dump-setup.outputs.ABI_HEADERS }} -o postgres-${{ matrix.ref }}.abi /usr/local/greenplum-db-devel/bin/postgres |
| 120 | +
|
| 121 | + - name: Upload ABI files |
| 122 | + uses: actions/upload-artifact@v3 |
| 123 | + with: |
| 124 | + name: ${{ matrix.name }} |
| 125 | + path: '*${{ matrix.ref }}.abi' |
| 126 | + |
| 127 | + abi-compare: |
| 128 | + needs: |
| 129 | + - abi-dump-setup |
| 130 | + - abi-dump |
| 131 | + runs-on: ubuntu-latest |
| 132 | + container: gcr.io/data-gpdb-public-images/gpdb7-rocky8-build |
| 133 | + steps: |
| 134 | + - name: Download baseline |
| 135 | + uses: actions/download-artifact@v3 |
| 136 | + with: |
| 137 | + name: build-baseline |
| 138 | + path: build-baseline/ |
| 139 | + - name: Download latest |
| 140 | + uses: actions/download-artifact@v3 |
| 141 | + with: |
| 142 | + name: build-latest |
| 143 | + path: build-latest/ |
| 144 | + |
| 145 | + - name: Download exception lists |
| 146 | + if: needs.abi-dump-setup.outputs.EXCEPTION_LISTS_COUNT != '0' |
| 147 | + uses: actions/download-artifact@v3 |
| 148 | + with: |
| 149 | + name: exception_lists |
| 150 | + path: exception_lists/ |
| 151 | + |
| 152 | + - name: Install abi-compliance-checker and report viewer (lynx) |
| 153 | + run: | |
| 154 | + yum install -y epel-release |
| 155 | + yum install -y abi-compliance-checker |
| 156 | + yum install -y --enablerepo=powertools lynx |
| 157 | +
|
| 158 | + - name: Compare ABI |
| 159 | + run: | |
| 160 | + SKIP_POSTGRES_SYMBOLS_LIST="exception_lists/postgres.symbols.ignore" |
| 161 | + SKIP_POSTGRES_SYMBOLS_OPTION="" |
| 162 | + if [[ -f "$SKIP_POSTGRES_SYMBOLS_LIST" ]]; then |
| 163 | + SKIP_POSTGRES_SYMBOLS_OPTION="-skip-symbols ${SKIP_POSTGRES_SYMBOLS_LIST}" |
| 164 | + fi |
| 165 | + SKIP_POSTGRES_TYPES_LIST="exception_lists/postgres.types.ignore" |
| 166 | + SKIP_POSTGRES_TYPES_OPTION="" |
| 167 | + if [[ -f "$SKIP_POSTGRES_TYPES_LIST" ]]; then |
| 168 | + SKIP_POSTGRES_TYPES_OPTION="-skip-types ${SKIP_POSTGRES_TYPES_LIST}" |
| 169 | + fi |
| 170 | + abi-compliance-checker ${SKIP_POSTGRES_SYMBOLS_OPTION} \ |
| 171 | + ${SKIP_POSTGRES_TYPES_OPTION} \ |
| 172 | + -lib postgres \ |
| 173 | + -old build-baseline/postgres*.abi \ |
| 174 | + -new build-latest/postgres*.abi |
| 175 | +
|
| 176 | + - name: Print out ABI report |
| 177 | + if: always() |
| 178 | + run: | |
| 179 | + lynx -dump $(find compat_reports/ | grep html) |
| 180 | +
|
| 181 | + - name: Upload ABI Comparison |
| 182 | + if: always() |
| 183 | + uses: actions/upload-artifact@v3 |
| 184 | + with: |
| 185 | + name: compat-report-${{ github.sha }} |
| 186 | + path: compat_reports/ |
0 commit comments