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
8f18482
chores(ci): opted-out nix-fast-build
yvan-sraka Jul 22, 2025
985854b
chores(ci): set up nix-github-actions
yvan-sraka Jul 24, 2025
173f556
chores(ci): comment out vestigal testinfra-ami-build
yvan-sraka Aug 11, 2025
d2855d0
chores(ci): use custom github runners
yvan-sraka Aug 11, 2025
84b0e7d
chores(ci): use nix-eval-jobs and sets AWS creds to /etc/nix/aws
yvan-sraka Sep 29, 2025
61d34f4
feat(ci): do not build if already cached
jfroche Sep 29, 2025
81c03b8
chore: improve reproducibility of postgresql builds
jfroche Sep 29, 2025
8ff188a
chore: remove nix-github-actions dependency
jfroche Sep 29, 2025
166cc45
feat(ci): split nix build workflow into separate extensions and check…
jfroche Sep 30, 2025
ed6deb4
feat(ci): extract nix build setup into reusable action and split buil…
jfroche Sep 30, 2025
b849901
fix(ci): do not hide cached builds
jfroche Sep 30, 2025
d94e344
Revert "fix(ci): do not hide cached builds"
jfroche Sep 30, 2025
5a20c98
chore: Temporarily disable x86_64-linux builds
jfroche Sep 30, 2025
8b9cdd5
fix: sort packages and filter out cached ones
jfroche Sep 30, 2025
845b3d7
fix: do not skip checks-matrix if dependencies are skipped
jfroche Sep 30, 2025
4a0d678
fix: do not return debug fields in GitHub Actions matrix output
jfroche Sep 30, 2025
df468a4
debugging
jfroche Sep 30, 2025
e657056
fix(ci): use !cancelled() instead of always() for dependent job condi…
jfroche Oct 2, 2025
f414400
fix(ci): stop chaining aws roles
jfroche Oct 2, 2025
f69715d
ci: run nixos test on aarch64-linux
jfroche Oct 2, 2025
47df102
fix(ci): disable eval-cache and accept-flake-config
jfroche Oct 2, 2025
578f83d
ci: split checks build jobs by system architecture
jfroche Oct 2, 2025
bd89688
fix(ci): use correct architecture name in aarch64-linux builds
jfroche Oct 3, 2025
e1a0e28
fix(ci): do not try to build already cached checks
jfroche Oct 3, 2025
bdcf0aa
fix(ci): simplify GitHub Actions workflow for Nix builds
jfroche Oct 3, 2025
d6290b3
Revert "chores(ci): comment out vestigal testinfra-ami-build"
jfroche Oct 3, 2025
2b86d37
feat(ci): eval on blacksmith-32vcpu-ubuntu-2404
jfroche Oct 3, 2025
4f632d9
feat: add ephemeral Nix install action for GitHub runners
jfroche Oct 3, 2025
ed29214
refactor(ci): extract nix eval into reusable workflow
jfroche Oct 3, 2025
90b1b52
feat: enable x86_64-linux builds in CI
jfroche Oct 6, 2025
d81a96a
feat: add PostgreSQL version to GitHub Actions job names
jfroche Oct 6, 2025
bdac8a3
fix: disable treefmt flake check
jfroche Oct 6, 2025
f71a3f2
feat: run actionlint on new GitHub Actions workflows
jfroche Oct 6, 2025
bc3f10e
chore: improve github matrix script type annotations
jfroche Oct 6, 2025
0fa7e7b
feat: optimize CI runner selection based on package size
jfroche Oct 6, 2025
958d75c
chore: fix package meta maintainers format
jfroche Oct 6, 2025
ba33531
chore: create a nix package for generating GitHub Actions matrix
jfroche Oct 6, 2025
47fdc1d
fix: configure runner according to the matrix job
jfroche Oct 6, 2025
55828f7
Update nix-eval-jobs
jfroche Oct 14, 2025
059280d
refactor(ci): standardize nix installation and disable cache push by …
jfroche Oct 27, 2025
374c563
feat: use big-parallel to identify large packages
jfroche Oct 27, 2025
e2ffcc4
fix(ci): ensure x86_64-linux build is considered in testinfra and tes…
jfroche Oct 27, 2025
607d7ad
fix: nix devShell inclusion condition
jfroche Oct 27, 2025
4a4a21b
fix(ci): eval should fail if github-matrix run fails
jfroche Oct 29, 2025
4c30d34
fix(ci): remove redundant build psql bundle step
yvan-sraka Nov 14, 2025
7e2aae6
fix: reduce ARM runner size from 8vcpu to 4vcpu for ephemeral builds
jfroche Nov 14, 2025
d49a0f5
Revert "fix(ci): limit max-jobs of nix to 8 to prevent OOM while runn…
yvan-sraka Nov 21, 2025
3d15630
feat: do not return empty matrices if no package has to be built
jfroche Nov 24, 2025
679ac53
feat: fail pipeline if nix evaluation fails
jfroche Nov 24, 2025
e302372
Update nix/ext/pgvector.nix
yvan-sraka Nov 24, 2025
20fa875
fix: add skip job only for systems that don't have any job
jfroche Nov 25, 2025
555a4af
fix(github-matrix): handle evaluation errors without deadlock
jfroche Nov 25, 2025
6b979ac
feat(github-matrix): integrate github-action-utils for better error v…
jfroche Nov 25, 2025
88d2404
feat(github-matrix): group evaluation errors by message
jfroche Nov 25, 2025
f9729d5
fix(github-matrix): improve multiline error display in GitHub Actions
jfroche Nov 25, 2025
b0d6088
fix(ci): skip run-testinfra and run-tests when nix-eval fails
jfroche Nov 25, 2025
7992f43
chore(github-matrix): update message when there are no build for a sy…
jfroche Nov 25, 2025
a5fc472
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