Repository navigation
53 lines (48 loc) · 1.75 KB
/
Copy pathtest.yml
File metadata and controls
53 lines (48 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Test Database
on:
workflow_dispatch:
workflow_call:
permissions:
contents: read
id-token: write
jobs:
gen-matrix:
runs-on: blacksmith-4vcpu-ubuntu-2404
outputs:
postgres_major_versions: ${{ steps.set-versions.outputs.postgres_major_versions }}
steps:
- name: Checkout Repo
uses: actions/checkout@v7.0.1
- uses: $/.github/actions/install-nix
- name: Set PostgreSQL versions
id: set-versions
run: |
VERSIONS=$(nix run nixpkgs#yq-go -- -o=json -I=0 '.postgres_major' ansible/vars.yml)
echo "postgres_major_versions=$VERSIONS" >> $GITHUB_OUTPUT
verify:
needs: gen-matrix
strategy:
matrix:
postgres_major_version: ${{ fromJson(needs.gen-matrix.outputs.postgres_major_versions) }}
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 180
env:
POSTGRES_PORT: 5478
POSTGRES_PASSWORD: password
steps:
- name: Checkout Repo
uses: actions/checkout@v7.0.1
- uses: $/.github/actions/install-nix
- name: Resolve git sha
id: resolve-git-sha
uses: $/.github/actions/resolve-git-sha
with:
flake_input: ${{ vars.GIT_SHA_FROM_FLAKE_INPUT }}
- name: verify schema.sql is committed
run: |
nix run github:supabase/postgres/${{ steps.resolve-git-sha.outputs.sha }}#dbmate-tool -- --version ${{ matrix.postgres_major_version }} --flake-url github:supabase/postgres/${{ steps.resolve-git-sha.outputs.sha }}
if ! git diff --exit-code --quiet migrations/schema-${{ matrix.postgres_major_version }}.sql; then
echo "Detected changes in schema.sql:"
git diff migrations/schema-${{ matrix.postgres_major_version }}.sql
exit 1
fi