-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
232 additions
and
301 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,218 +17,27 @@ jobs: | |
steps: | ||
- name: Check out repository | ||
uses: actions/[email protected] | ||
|
||
- name: Install Nix | ||
uses: cachix/install-nix-action@v21 | ||
|
||
- name: Install python | ||
uses: actions/setup-python@v3 | ||
- name: Run pre-commit hooks | ||
run: nix-shell --pure --run 'pre-commit run --all-files' | ||
uses: pre-commit/[email protected] | ||
|
||
test-install-from-source: | ||
name: Test PostgreSQL ${{ matrix.pg }} source install on Ubuntu ${{ matrix.release }} | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
pg: ['11', '12', '13', '14', '15'] | ||
release: [focal, jammy] | ||
steps: | ||
- name: Check out repository | ||
uses: actions/[email protected] | ||
|
||
- name: Build Docker container | ||
run: docker build --build-arg=RELEASE=${{ matrix.release }} --tag=tester . | ||
|
||
- name: Install from source | ||
run: docker run --rm tester ./test/ci/install-from-source.bash ${{ matrix.pg }} | ||
|
||
test-package-upgrade: | ||
name: Test PostgreSQL ${{ matrix.pg }} package upgrade on Ubuntu ${{ matrix.release }} | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
pg: ['11', '12', '13', '14'] # TODO: '15' | ||
release: [focal] # TODO: jammy | ||
steps: | ||
- name: Check out repository | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build package | ||
uses: linz/linz-software-repository@v15 | ||
with: | ||
release: ${{ matrix.release }} | ||
packages: jq | ||
|
||
- name: Build Docker container | ||
run: docker build --build-arg=RELEASE=${{ matrix.release }} --tag=tester . | ||
|
||
- name: Upgrade from latest release | ||
run: | ||
docker run --rm --volume="${PWD}/build-area:/packages" tester | ||
./test/ci/package-upgrade.bash ${{ matrix.pg }} | ||
|
||
- name: Archive generated packages | ||
uses: actions/[email protected] | ||
with: | ||
name: PostgreSQL ${{ matrix.pg }} packages for Ubuntu ${{ matrix.release }} | ||
path: 'build-area/*.deb' | ||
if: failure() | ||
|
||
test-source-upgrade: | ||
name: Test PostgreSQL ${{ matrix.pg }} source upgrade on Ubuntu ${{ matrix.release }} | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
pg: ['11', '12', '13', '14'] # TODO: '15' | ||
release: [focal] # TODO: jammy | ||
steps: | ||
- name: Check out repository | ||
uses: actions/[email protected] | ||
|
||
- name: Build Docker container | ||
run: docker build --build-arg=RELEASE=${{ matrix.release }} --tag=tester . | ||
|
||
- name: Upgrade from source | ||
run: docker run --rm tester ./test/ci/source-upgrade.bash ${{ matrix.pg }} | ||
|
||
test-source-upgrade-using-loader: | ||
name: | ||
Test PostgreSQL ${{ matrix.pg }} package upgrade using loader on Ubuntu ${{ matrix.release }} | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
pg: ['11', '12', '13', '14'] # TODO: '15' | ||
release: [focal] # TODO: jammy | ||
steps: | ||
- name: Check out repository | ||
uses: actions/[email protected] | ||
|
||
- name: Build Docker container | ||
run: docker build --build-arg=RELEASE=${{ matrix.release }} --tag=tester . | ||
|
||
- name: Upgrade from latest release | ||
run: docker run --rm tester ./test/ci/source-upgrade-using-loader.bash ${{ matrix.pg }} | ||
|
||
test-source-upgrade-using-loader-without-extension-support: | ||
name: | ||
Test PostgreSQL ${{ matrix.pg }} package upgrade using loader without extension support on | ||
Ubuntu ${{ matrix.release }} | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
pg: ['11', '12', '13', '14'] # TODO: '15' | ||
release: [focal] # TODO: jammy | ||
steps: | ||
- name: Check out repository | ||
uses: actions/[email protected] | ||
|
||
- name: Build Docker container | ||
run: docker build --build-arg=RELEASE=${{ matrix.release }} --tag=tester . | ||
|
||
- name: Upgrade from latest release | ||
run: | ||
docker run --rm tester | ||
./test/ci/source-upgrade-using-loader-without-extension-support.bash ${{ matrix.pg }} | ||
|
||
test-package: | ||
name: Test PostgreSQL ${{ matrix.pg }} package install on ${{ matrix.release }} | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
pg: ['11', '12', '13', '14'] # TODO: '15' | ||
release: [focal] # TODO: jammy | ||
pg: ['12', '13', '14', '15', '16'] | ||
release: [20.04, 22.04] | ||
steps: | ||
- name: Check out repository | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build package | ||
uses: linz/linz-software-repository@v15 | ||
with: | ||
release: ${{ matrix.release }} | ||
packages: jq | ||
|
||
- name: Build Docker container | ||
run: docker build --build-arg=RELEASE=${{ matrix.release }} --tag=tester . | ||
|
||
- name: Upgrade from latest release | ||
run: | ||
docker run --rm --volume="${PWD}/build-area:/packages" tester | ||
./test/ci/install-local-package.bash ${{ matrix.pg }} | ||
docker build --build-arg=RELEASE=${{ matrix.release }} --build-arg="PG_VERSION=${{ | ||
matrix.pg }}" --tag=tester . | ||
|
||
package: | ||
needs: | ||
- lint | ||
- test-install-from-source | ||
- test-package | ||
- test-package-upgrade | ||
- test-source-upgrade | ||
- test-source-upgrade-using-loader | ||
- test-source-upgrade-using-loader-without-extension-support | ||
name: Package for Ubuntu ${{ matrix.release }} | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
release: [focal, jammy] | ||
max-parallel: 1 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Determine packagecloud publication target | ||
run: | | ||
# TODO: it would be nice to turn this into a single-liner in | ||
# github-action syntax | ||
echo "GitHub ref: ${{ github.ref }}" | ||
echo "GitHub event_name: ${{ github.event_name }}" | ||
REPO= | ||
if test "${{ github.event_name }}" = 'push'; then | ||
if expr "${{ github.ref }}" : "refs/tags/" > /dev/null; then | ||
REPO=test | ||
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY | ||
elif test "${{ github.ref }}" = 'refs/heads/packagecloud' \ | ||
-o "${{ github.ref }}" = 'refs/heads/master' | ||
then | ||
REPO=dev | ||
fi | ||
fi | ||
echo "REPO=$REPO" | tee --append $GITHUB_ENV | ||
- name: Build and release package | ||
uses: linz/linz-software-repository@v15 | ||
with: | ||
release: ${{ matrix.release }} | ||
packages: jq | ||
packagecloud_token: ${{ secrets.LINZCI_PACKAGECLOUD_TOKEN }} | ||
packagecloud_repository: ${{ env.REPO }} | ||
push_to_git_remote: origin | ||
|
||
finalise: | ||
name: Verify all dependencies passed | ||
if: always() | ||
needs: | ||
- lint | ||
- package | ||
- test-install-from-source | ||
- test-package | ||
- test-package-upgrade | ||
- test-source-upgrade | ||
- test-source-upgrade-using-loader | ||
- test-source-upgrade-using-loader-without-extension-support | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/[email protected] | ||
with: | ||
jobs: ${{ toJSON(needs) }} | ||
- name: Install from source | ||
run: docker run --rm tester ./test/ci/install-from-source.bash |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,14 +120,8 @@ BEGIN | |
INTO v_table_has_data; | ||
|
||
IF v_table_has_data THEN | ||
IF @extschema@._ver_get_reversion_temp_table('_changeset_revision') THEN | ||
SELECT | ||
max(VER.revision) | ||
INTO | ||
v_revision | ||
FROM | ||
_changeset_revision VER; | ||
|
||
IF coalesce(current_setting('table_version.current_revision', TRUE), '') <> '' THEN | ||
v_revision := current_setting('table_version.current_revision', TRUE)::INTEGER; | ||
v_revision_exists := TRUE; | ||
ELSE | ||
SELECT @[email protected]_create_revision( | ||
|
Oops, something went wrong.