Refactoring. #28
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: Test | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: ["master"] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| pg_version: [12, 13, 14, 15, 16, 17] | |
| build: [automake, meson] | |
| container: | |
| image: ghcr.io/postgres-dev/ubuntu-22.04:1.0 | |
| options: --privileged | |
| env: | |
| PGDATA: /tmp/pgdata | |
| PG_BRANCH: ${{ format('REL_{0}_STABLE', matrix.pg_version) }} | |
| steps: | |
| # Get Postgres sources | |
| - name: Checkout PostgreSQL | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: postgres/postgres | |
| ref: ${{ format('REL_{0}_STABLE', matrix.pg_version) }} | |
| path: postgres | |
| # Get extension | |
| - name: Checkout shared_ispell | |
| uses: actions/checkout@v3 | |
| # Install Postgres | |
| - name: Install PostgreSQL | |
| run: | | |
| make -C postgres install-world-bin prefix=$HOME/pgsql | |
| echo "$HOME/pgsql/bin" >> $GITHUB_PATH | |
| # Set PG_CONFIG | |
| - name: Set PG_CONFIG | |
| run: | | |
| echo "PG_CONFIG=$HOME/pgsql/bin/pg_config" >> $GITHUB_ENV | |
| # Init + start server | |
| - name: Start PostgreSQL | |
| run: | | |
| initdb -D $PGDATA | |
| pg_ctl -D $PGDATA -o "-F -k /tmp" -w start | |
| # Build extension (automake) | |
| - name: Build (automake) | |
| if: matrix.build == 'automake' | |
| run: | | |
| make USE_PGXS=1 | |
| make USE_PGXS=1 install | |
| # Build extension (meson) | |
| - name: Build (meson) | |
| if: matrix.build == 'meson' | |
| run: | | |
| PREFIX=$($PG_CONFIG --pgxs | sed 's|/lib/pgxs/src/makefiles/pgxs.mk||') | |
| meson setup builddir --prefix=$PREFIX | |
| meson compile -C builddir | |
| meson install -C builddir | |
| # Create extension + run tests | |
| - name: Run SQL tests | |
| run: | | |
| createdb test | |
| psql -d test -c "CREATE EXTENSION shared_ispell;" | |
| for f in sql/*.sql; do | |
| echo "Running $f" | |
| psql -d test -f "$f" | |
| done |