From 9357c5e89898a90af8024edbe7b9a3efa11bc2b8 Mon Sep 17 00:00:00 2001 From: Mark Merritt Date: Mon, 1 Jun 2026 16:26:01 -0700 Subject: [PATCH 1/4] fix start-postgres chown order + add ARC smoke test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The original chown ran before apt-get install, which works on GH-hosted ubuntu images that bake in the postgres user but fails on the minimal ghcr.io/actions/actions-runner image used by ARC — the user is created by the postgresql-N postinst, not before. Move chown after install. Add a matrixed smoke test (hosted + arc-runner-4) so this divergence gets caught by CI instead of by the first downstream caller. --- .github/actions/start-postgres/action.yaml | 5 +++- .github/workflows/test-start-postgres.yml | 34 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test-start-postgres.yml diff --git a/.github/actions/start-postgres/action.yaml b/.github/actions/start-postgres/action.yaml index d615248..180811a 100644 --- a/.github/actions/start-postgres/action.yaml +++ b/.github/actions/start-postgres/action.yaml @@ -37,11 +37,14 @@ runs: pg_bin="/usr/lib/postgresql/${POSTGRES_VERSION}/bin" pg_data="$(mktemp -d /tmp/start-postgres.XXXXXX)" - sudo chown postgres:postgres "$pg_data" pg_log="$pg_data/postgres.log" sudo apt-get update sudo apt-get install -y "postgresql-${POSTGRES_VERSION}" + # postinst from postgresql-N is what creates the `postgres` user, so + # chown can only run after install — on minimal images (ARC) the user + # doesn't exist before this point. + sudo chown postgres:postgres "$pg_data" sudo -u postgres "$pg_bin/initdb" \ -D "$pg_data" --auth=trust sudo -u postgres "$pg_bin/pg_ctl" \ diff --git a/.github/workflows/test-start-postgres.yml b/.github/workflows/test-start-postgres.yml new file mode 100644 index 0000000..c810d14 --- /dev/null +++ b/.github/workflows/test-start-postgres.yml @@ -0,0 +1,34 @@ +name: test start-postgres + +on: + push: + branches: [main] + paths: + - .github/actions/start-postgres/** + - .github/workflows/test-start-postgres.yml + pull_request: + paths: + - .github/actions/start-postgres/** + - .github/workflows/test-start-postgres.yml + +jobs: + smoke: + strategy: + fail-fast: false + matrix: + # GH-hosted and ARC behave differently — hosted images bake in the + # postgres user, ARC runners do not. Both must work. + runner: [ubuntu-24.04, arc-runner-4] + runs-on: ${{ matrix.runner }} + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/start-postgres + with: + version: "16" + database: smoke_db + password: "pa'ssword" + - shell: bash + run: | + set -euo pipefail + psql -h localhost -U postgres -d postgres -Atqc "SELECT 1" + psql -h localhost -U postgres -d smoke_db -Atqc "SELECT current_database()" From 2e88d799608bd8e8804f3bde62804a93800f430a Mon Sep 17 00:00:00 2001 From: Mark Merritt Date: Mon, 1 Jun 2026 16:39:22 -0700 Subject: [PATCH 2/4] smoke test: arc-runner-1 (smallest size is enough) --- .github/workflows/test-start-postgres.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-start-postgres.yml b/.github/workflows/test-start-postgres.yml index c810d14..ae698d0 100644 --- a/.github/workflows/test-start-postgres.yml +++ b/.github/workflows/test-start-postgres.yml @@ -18,7 +18,7 @@ jobs: matrix: # GH-hosted and ARC behave differently — hosted images bake in the # postgres user, ARC runners do not. Both must work. - runner: [ubuntu-24.04, arc-runner-4] + runner: [ubuntu-24.04, arc-runner-1] runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@v4 From 62986889fb6476fbd212c2cc8f393de0d2cf2fb2 Mon Sep 17 00:00:00 2001 From: Mark Merritt Date: Mon, 1 Jun 2026 16:50:00 -0700 Subject: [PATCH 3/4] smoke test: drop ARC leg (public repo + runner group restriction) --- .github/workflows/test-start-postgres.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-start-postgres.yml b/.github/workflows/test-start-postgres.yml index ae698d0..2d2be00 100644 --- a/.github/workflows/test-start-postgres.yml +++ b/.github/workflows/test-start-postgres.yml @@ -13,13 +13,10 @@ on: jobs: smoke: - strategy: - fail-fast: false - matrix: - # GH-hosted and ARC behave differently — hosted images bake in the - # postgres user, ARC runners do not. Both must work. - runner: [ubuntu-24.04, arc-runner-1] - runs-on: ${{ matrix.runner }} + # The interesting target for this action is ARC, but org runner groups + # block self-hosted runners on public repos. Smoke runs hosted-only; ARC + # behavior is exercised by downstream callers (private repos). + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - uses: ./.github/actions/start-postgres From f12ab3be988cf0ad50dde257c2d8b2d79e08f354 Mon Sep 17 00:00:00 2001 From: Mark Merritt Date: Mon, 1 Jun 2026 16:51:06 -0700 Subject: [PATCH 4/4] drop smoke test workflow --- .github/workflows/test-start-postgres.yml | 31 ----------------------- 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/test-start-postgres.yml diff --git a/.github/workflows/test-start-postgres.yml b/.github/workflows/test-start-postgres.yml deleted file mode 100644 index 2d2be00..0000000 --- a/.github/workflows/test-start-postgres.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: test start-postgres - -on: - push: - branches: [main] - paths: - - .github/actions/start-postgres/** - - .github/workflows/test-start-postgres.yml - pull_request: - paths: - - .github/actions/start-postgres/** - - .github/workflows/test-start-postgres.yml - -jobs: - smoke: - # The interesting target for this action is ARC, but org runner groups - # block self-hosted runners on public repos. Smoke runs hosted-only; ARC - # behavior is exercised by downstream callers (private repos). - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/start-postgres - with: - version: "16" - database: smoke_db - password: "pa'ssword" - - shell: bash - run: | - set -euo pipefail - psql -h localhost -U postgres -d postgres -Atqc "SELECT 1" - psql -h localhost -U postgres -d smoke_db -Atqc "SELECT current_database()"