Skip to content

Run

Run #876

Workflow file for this run

name: Run
on:
schedule:
# The docs suggest not to schedule this on the full hour:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '42 0,8,16 * * *'
jobs:
run:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
builder:
- autoconf
branch:
- REL_12_STABLE
- REL_13_STABLE
- REL_14_STABLE
- REL_15_STABLE
- REL_16_STABLE
- REL_17_STABLE
- HEAD
include:
- builder: meson
branch: REL_16_STABLE
- builder: meson
branch: REL_17_STABLE
- builder: meson
branch: HEAD
name: ${{ matrix.branch }} (${{ matrix.builder }})
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
- name: Build Dockerfile
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0
with:
context: .
load: true
push: false
tags: buildfarm-client:alpine
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: postgres/postgres
ref: ${{ matrix.branch != 'HEAD' && matrix.branch || '' }}
path: source
# TODO: Change to shallow-since once this is solved:
# https://github.com/actions/checkout/issues/947
fetch-depth: 100
- id: postgres
run: echo "commit=$(git -C source rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: build
key: run-alpine-${{ matrix.builder }}-${{ matrix.branch }}-${{ steps.postgres.outputs.commit }}
restore-keys: run-alpine-${{ matrix.builder }}-${{ matrix.branch }}-
- name: Run buildfarm client
run: |
mkdir -p build
docker run --rm \
-e ANIMAL=${{ matrix.builder == 'autoconf' && vars.AUTOCONF_ANIMAL || vars.MESON_ANIMAL }} \
-e SECRET=${{ matrix.builder == 'autoconf' && secrets.AUTOCONF_SECRET || secrets.MESON_SECRET }} \
-v ./build:/mnt/build \
-v ./source:/mnt/source \
-u "$(id -u):$(id -g)" \
buildfarm-client:alpine \
--force \
--config ${{ matrix.builder }}.conf \
${{ matrix.branch }}
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
if: always()
with:
name: ${{ matrix.builder }}-${{ matrix.branch }}-logs
path: build/**/*.log
if-no-files-found: error