Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f5c1ddb
chores(ci): opted-out nix-fast-build
yvan-sraka Jul 22, 2025
b2865e2
chores(ci): set up nix-github-actions
yvan-sraka Jul 24, 2025
592085a
chores(ci): comment out vestigal testinfra-ami-build
yvan-sraka Aug 11, 2025
83a66a9
chores(ci): use custom github runners
yvan-sraka Aug 11, 2025
3a4209c
chores(ci): use nix-eval-jobs and sets AWS creds to /etc/nix/aws
yvan-sraka Sep 29, 2025
a45eef5
feat(ci): do not build if already cached
jfroche Sep 29, 2025
f213d8a
chore: improve reproducibility of postgresql builds
jfroche Sep 29, 2025
4cc20b0
chore: remove nix-github-actions dependency
jfroche Sep 29, 2025
78cd19a
feat(ci): split nix build workflow into separate extensions and check…
jfroche Sep 30, 2025
bcec041
feat(ci): extract nix build setup into reusable action and split buil…
jfroche Sep 30, 2025
9c1ba97
fix(ci): do not hide cached builds
jfroche Sep 30, 2025
4ba49a0
Revert "fix(ci): do not hide cached builds"
jfroche Sep 30, 2025
58b5207
chore: Temporarily disable x86_64-linux builds
jfroche Sep 30, 2025
8a6d7d7
fix: sort packages and filter out cached ones
jfroche Sep 30, 2025
76848de
fix: do not skip checks-matrix if dependencies are skipped
jfroche Sep 30, 2025
2aea2f5
fix: do not return debug fields in GitHub Actions matrix output
jfroche Sep 30, 2025
0ef9fac
debugging
jfroche Sep 30, 2025
438f65d
fix(ci): use !cancelled() instead of always() for dependent job condi…
jfroche Oct 2, 2025
a7e2c55
fix(ci): stop chaining aws roles
jfroche Oct 2, 2025
83f2553
ci: run nixos test on aarch64-linux
jfroche Oct 2, 2025
80131e1
fix(ci): disable eval-cache and accept-flake-config
jfroche Oct 2, 2025
f19c5db
ci: split checks build jobs by system architecture
jfroche Oct 2, 2025
aa766ef
fix(ci): use correct architecture name in aarch64-linux builds
jfroche Oct 3, 2025
e3fb68a
fix(ci): do not try to build already cached checks
jfroche Oct 3, 2025
18f50c9
fix(ci): simplify GitHub Actions workflow for Nix builds
jfroche Oct 3, 2025
a2d8eca
Revert "chores(ci): comment out vestigal testinfra-ami-build"
jfroche Oct 3, 2025
5d785f4
feat(ci): eval on blacksmith-32vcpu-ubuntu-2404
jfroche Oct 3, 2025
04de85a
feat: add ephemeral Nix install action for GitHub runners
jfroche Oct 3, 2025
c81af04
refactor(ci): extract nix eval into reusable workflow
jfroche Oct 3, 2025
7e494cc
feat: enable x86_64-linux builds in CI
jfroche Oct 6, 2025
a8f986e
feat: add PostgreSQL version to GitHub Actions job names
jfroche Oct 6, 2025
1dc3a3a
fix: disable treefmt flake check
jfroche Oct 6, 2025
aa842d2
feat: run actionlint on new GitHub Actions workflows
jfroche Oct 6, 2025
27fa055
chore: improve github matrix script type annotations
jfroche Oct 6, 2025
43b3157
feat: optimize CI runner selection based on package size
jfroche Oct 6, 2025
f6a1894
chore: fix package meta maintainers format
jfroche Oct 6, 2025
124063d
chore: create a nix package for generating GitHub Actions matrix
jfroche Oct 6, 2025
b987c8e
fix: configure runner according to the matrix job
jfroche Oct 6, 2025
1e03a64
Update nix-eval-jobs
jfroche Oct 14, 2025
13f5eb4
refactor(ci): standardize nix installation and disable cache push by …
jfroche Oct 27, 2025
6c69933
feat: use big-parallel to identify large packages
jfroche Oct 27, 2025
537a44e
fix(ci): ensure x86_64-linux build is considered in testinfra and tes…
jfroche Oct 27, 2025
30a0f9c
fix: nix devShell inclusion condition
jfroche Oct 27, 2025
53da93d
fix(ci): eval should fail if github-matrix run fails
jfroche Oct 29, 2025
2b133c8
fix(ci): remove redundant build psql bundle step
yvan-sraka Nov 14, 2025
afd1e7e
fix: reduce ARM runner size from 8vcpu to 4vcpu for ephemeral builds
jfroche Nov 14, 2025
7f433d9
Revert "fix(ci): limit max-jobs of nix to 8 to prevent OOM while runn…
yvan-sraka Nov 21, 2025
3c1ae28
feat: do not return empty matrices if no package has to be built
jfroche Nov 24, 2025
2c44443
feat: fail pipeline if nix evaluation fails
jfroche Nov 24, 2025
65e009a
Update nix/ext/pgvector.nix
yvan-sraka Nov 24, 2025
69e24cb
fix: add skip job only for systems that don't have any job
jfroche Nov 25, 2025
63398f0
fix(github-matrix): handle evaluation errors without deadlock
jfroche Nov 25, 2025
2f17aa7
feat(github-matrix): integrate github-action-utils for better error v…
jfroche Nov 25, 2025
5acfc8a
feat(github-matrix): group evaluation errors by message
jfroche Nov 25, 2025
1d35332
fix(github-matrix): improve multiline error display in GitHub Actions
jfroche Nov 25, 2025
1429ccd
fix(ci): skip run-testinfra and run-tests when nix-eval fails
jfroche Nov 25, 2025
9b659e4
chore(github-matrix): update message when there are no build for a sy…
jfroche Nov 25, 2025
efd8f49
fix(github-matrix): backward compatibility for Result access
jfroche Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
self-hosted-runner:
labels:
- aarch64-darwin
- aarch64-linux
- blacksmith-32vcpu-ubuntu-2404
1 change: 0 additions & 1 deletion .github/actions/nix-install-ephemeral/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@ runs:
substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com
trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
${{ inputs.push-to-cache == 'true' && 'post-build-hook = /etc/nix/upload-to-cache.sh' || '' }}
max-jobs = 8
30 changes: 30 additions & 0 deletions .github/actions/nix-install-self-hosted/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Configure Nix on self hosted runners'
description: 'Sets up AWS credentials to push to the Nix binary cache'
inputs:
aws-role-duration:
description: 'AWS role session duration in seconds'
required: false
default: '18000'

runs:
using: 'composite'
steps:
- name: aws-creds
uses: aws-actions/[email protected]
with:
disable-retry: true
aws-region: us-east-2
role-to-assume: arn:aws:iam::436098097459:role/nix-artifacts-deploy-role # supabase-dev
role-session-name: gha-oidc-${{ github.run_id }}
role-duration-seconds: ${{ inputs.aws-role-duration }}

- name: Write creds files
shell: bash
run: |
umask 006
cat > /etc/nix/aws/nix-aws-credentials <<EOF
[ci-uploader]
aws_access_key_id = ${AWS_ACCESS_KEY_ID}
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}
aws_session_token = ${AWS_SESSION_TOKEN}
EOF
148 changes: 92 additions & 56 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,77 +14,113 @@ permissions:
contents: write
packages: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build-run-image:
nix-eval:
uses: ./.github/workflows/nix-eval.yml
secrets:
DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }}
NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }}

nix-build-aarch64-linux:
name: >-
${{ matrix.name }}${{ matrix.postgresql_version && format(' - Postgres {0}', matrix.postgresql_version) || '' }}
(aarch64-linux)
needs: nix-eval
runs-on: ${{ matrix.runs_on.group && matrix.runs_on || matrix.runs_on.labels }}
if: ${{ fromJSON(needs.nix-eval.outputs.matrix).aarch64_linux != null }}
strategy:
fail-fast: false
matrix:
include:
- runner: blacksmith-32vcpu-ubuntu-2404
arch: amd64
- runner: blacksmith-32vcpu-ubuntu-2404-arm
arch: arm64
- runner: macos-latest-xlarge
arch: arm64
runs-on: ${{ matrix.runner }}
timeout-minutes: 180
max-parallel: 5
matrix: ${{ fromJSON(needs.nix-eval.outputs.matrix).aarch64_linux }}
steps:
- name: Checkout Repo
uses: supabase/postgres/.github/actions/shared-checkout@HEAD
- uses: ./.github/actions/nix-install-ephemeral
if: ${{ matrix.attr != '' }}
uses: actions/checkout@v4
- name: Install nix (ephemeral)
if: ${{ matrix.attr != '' && matrix.runs_on.group != 'self-hosted-runners-nix' }}
uses: ./.github/actions/nix-install-ephemeral
with:
push-to-cache: ${{ github.secret_source == 'Actions' && 'true' || 'false' }}
push-to-cache: 'true'
env:
DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }}
NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }}
- name: Aggressive disk cleanup for DuckDB build
if: matrix.runner == 'macos-latest-xlarge'
run: |
nix --version
echo "=== BEFORE CLEANUP ==="
df -h
# Remove major space consumers
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /usr/local/lib/android || true
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform || true
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/watchOS.platform || true
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/tvOS.platform || true
# Clean everything possible
sudo rm -rf /opt/ghc || true
sudo rm -rf /usr/local/share/boost || true
sudo rm -rf /opt/homebrew || true
sudo xcrun simctl delete all 2>/dev/null || true
# Aggressive cache cleanup
sudo rm -rf /System/Library/Caches/* 2>/dev/null || true
sudo rm -rf /Library/Caches/* 2>/dev/null || true
sudo rm -rf ~/Library/Caches/* 2>/dev/null || true
sudo rm -rf /private/var/log/* 2>/dev/null || true
sudo rm -rf /tmp/* 2>/dev/null || true
echo "=== AFTER CLEANUP ==="
df -h
-
name: Build psql bundle
run: >
nix run "github:Mic92/nix-fast-build?rev=b1dae483ab7d4139a6297e02b6de9e5d30e43d48"
-- --skip-cached --no-nom ${{ matrix.runner == 'macos-latest-xlarge' && '--max-jobs 1' || '' }}
--flake ".#checks.$(nix eval --raw --impure --expr 'builtins.currentSystem')"
- name: Install nix (self-hosted)
if: ${{ matrix.attr != '' && matrix.runs_on.group == 'self-hosted-runners-nix' }}
uses: ./.github/actions/nix-install-self-hosted
- name: nix build
if: ${{ matrix.attr != '' }}
shell: bash
run: nix build --accept-flake-config -L .#${{ matrix.attr }}

nix-build-aarch64-darwin:
name: >-
${{ matrix.name }}${{ matrix.postgresql_version && format(' - Postgres {0}', matrix.postgresql_version) || '' }}
(aarch64-darwin)
needs: nix-eval
runs-on: ${{ matrix.attr != '' && matrix.runs_on.group && matrix.runs_on || matrix.runs_on.labels }}
if: ${{ fromJSON(needs.nix-eval.outputs.matrix).aarch64_darwin != null }}
strategy:
fail-fast: false
max-parallel: 5
matrix: ${{ fromJSON(needs.nix-eval.outputs.matrix).aarch64_darwin }}
steps:
- name: Checkout Repo
if: ${{ matrix.attr != '' }}
uses: actions/checkout@v4
- name: Install nix
if: ${{ matrix.attr != '' }}
uses: ./.github/actions/nix-install-self-hosted
- name: nix build
if: ${{ matrix.attr != '' }}
shell: bash
run: nix build --accept-flake-config -L .#${{ matrix.attr }}

nix-build-x86_64-linux:
name: >-
${{ matrix.name }}${{ matrix.postgresql_version && format(' - Postgres {0}', matrix.postgresql_version) || '' }}
(x86_64-linux)
needs: nix-eval
runs-on: ${{ matrix.attr != '' && matrix.runs_on.group && matrix.runs_on || matrix.runs_on.labels }}
if: ${{ fromJSON(needs.nix-eval.outputs.matrix).x86_64_linux != null }}
strategy:
fail-fast: false
max-parallel: 5
matrix: ${{ fromJSON(needs.nix-eval.outputs.matrix).x86_64_linux }}
steps:
- name: Checkout Repo
if: ${{ matrix.attr != '' }}
uses: actions/checkout@v4
- name: Install nix
if: ${{ matrix.attr != '' }}
uses: ./.github/actions/nix-install-ephemeral
with:
push-to-cache: 'true'
env:
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }}
NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }}
- name: nix build
if: ${{ matrix.attr != '' }}
shell: bash
run: nix build --accept-flake-config -L .#${{ matrix.attr }}

run-testinfra:
needs: build-run-image
if: ${{ success() }}
needs: [nix-eval, nix-build-aarch64-linux, nix-build-aarch64-darwin, nix-build-x86_64-linux]
if: |
!cancelled() &&
needs.nix-eval.result == 'success' &&
(needs.nix-build-aarch64-linux.result == 'skipped' || needs.nix-build-aarch64-linux.result == 'success') &&
(needs.nix-build-aarch64-darwin.result == 'skipped' || needs.nix-build-aarch64-darwin.result == 'success') &&
(needs.nix-build-x86_64-linux.result == 'skipped' || needs.nix-build-x86_64-linux.result == 'success')
uses: ./.github/workflows/testinfra-ami-build.yml
secrets:
DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }}

run-tests:
needs: build-run-image
if: ${{ success() }}
needs: [nix-eval, nix-build-aarch64-linux, nix-build-aarch64-darwin, nix-build-x86_64-linux]
if: |
!cancelled() &&
needs.nix-eval.result == 'success' &&
(needs.nix-build-aarch64-linux.result == 'skipped' || needs.nix-build-aarch64-linux.result == 'success') &&
(needs.nix-build-aarch64-darwin.result == 'skipped' || needs.nix-build-aarch64-darwin.result == 'success') &&
(needs.nix-build-x86_64-linux.result == 'skipped' || needs.nix-build-x86_64-linux.result == 'success')
uses: ./.github/workflows/test.yml
34 changes: 34 additions & 0 deletions .github/workflows/nix-eval.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Nix Eval

on:
workflow_call:
outputs:
matrix:
description: 'Generated build matrix'
value: ${{ jobs.eval.outputs.matrix }}
secrets:
DEV_AWS_ROLE:
required: false
NIX_SIGN_SECRET_KEY:
required: false

jobs:
eval:
runs-on: blacksmith-32vcpu-ubuntu-2404
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Install nix
uses: ./.github/actions/nix-install-ephemeral
with:
push-to-cache: 'true'
env:
DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }}
NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }}
- id: set-matrix
name: Generate Nix Matrix
run: |
set -Eeu -o pipefail
nix run --accept-flake-config .\#github-matrix -- checks legacyPackages
Loading
Loading