Skip to content

Commit 5abba2b

Browse files
committed
feat: enable x86_64-linux builds in CI
1 parent 43e882b commit 5abba2b

File tree

3 files changed

+35
-36
lines changed

3 files changed

+35
-36
lines changed

.github/actions/nix-install-ephemeral/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'Install Nix on ephemeral runners'
2-
description: 'Installs Nix and sets up AWS credentials for pushing to Nix binary cache'
2+
description: 'Installs Nix and sets up AWS credentials to push to the Nix binary cache'
33
inputs:
44
push-to-cache:
55
description: 'Whether to push build outputs to the Nix binary cache'
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
name: 'Nix Build Setup'
2-
description: 'Sets up AWS credentials and builds a Nix package'
1+
name: 'Configure Nix on self hosted runners'
2+
description: 'Sets up AWS credentials to push to the Nix binary cache'
33
inputs:
4-
attr:
5-
description: 'The Nix attribute to build'
6-
required: true
74
aws-role-duration:
85
description: 'AWS role session duration in seconds'
96
required: false
10-
default: '3600'
7+
default: '18000'
118

129
runs:
1310
using: 'composite'
@@ -19,7 +16,7 @@ runs:
1916
aws-region: us-east-2
2017
role-to-assume: arn:aws:iam::436098097459:role/nix-artifacts-deploy-role # supabase-dev
2118
role-session-name: gha-oidc-${{ github.run_id }}
22-
role-duration-seconds: 18000
19+
role-duration-seconds: ${{ inputs.aws-role-duration }}
2320

2421
- name: Write creds files
2522
shell: bash
@@ -31,6 +28,3 @@ runs:
3128
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}
3229
aws_session_token = ${AWS_SESSION_TOKEN}
3330
EOF
34-
- name: nix build
35-
shell: bash
36-
run: nix build --accept-flake-config -L .#${{ inputs.attr }}

.github/workflows/nix-build.yml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ jobs:
3434
- name: Checkout Repo
3535
uses: actions/checkout@v4
3636
- name: Build Nix Package
37-
uses: ./.github/actions/nix-build-self-hosted
38-
with:
39-
attr: ${{ matrix.attr }}
37+
uses: ./.github/actions/nix-install-self-hosted
38+
- name: nix build
39+
shell: bash
40+
run: nix build --accept-flake-config -L .#${{ matrix.attr }}
4041

4142
nix-build-aarch64-darwin:
4243
name: ${{ matrix.name }} (aarch64-darwin)
@@ -51,30 +52,34 @@ jobs:
5152
- name: Checkout Repo
5253
uses: actions/checkout@v4
5354
- name: Build Nix Package
54-
uses: ./.github/actions/nix-build-self-hosted
55-
with:
56-
attr: ${{ matrix.attr }}
55+
uses: ./.github/actions/nix-install-self-hosted
56+
- name: nix build
57+
shell: bash
58+
run: nix build --accept-flake-config -L .#${{ matrix.attr }}
5759

58-
# TODO
59-
# nix-build-x86_64-linux:
60-
# name: ${{matrix.postgresql_version}}.${{ matrix.name }} (x86_64-linux)
61-
# needs: nix-eval
62-
# runs-on: ${{ matrix.runs_on.group && matrix.runs_on || matrix.runs_on.labels }}
63-
# if: ${{ fromJSON(needs.nix-eval.outputs.matrix).x86_64_linux != null }}
64-
# strategy:
65-
# fail-fast: false
66-
# max-parallel: 3
67-
# matrix: ${{ fromJSON(needs.nix-eval.outputs.matrix).x86_64_linux }}
68-
# steps:
69-
# - name: Checkout Repo
70-
# uses: actions/checkout@v4
71-
# - name: Build Nix Package
72-
# uses: ./.github/actions/nix-build-self-hosted
73-
# with:
74-
# attr: ${{ matrix.attr }}
60+
nix-build-x86_64-linux:
61+
name: ${{ matrix.name }} (x86_64-linux)
62+
needs: nix-eval
63+
runs-on: ${{ matrix.runs_on.group && matrix.runs_on || matrix.runs_on.labels }}
64+
if: ${{ fromJSON(needs.nix-eval.outputs.matrix).x86_64_linux != null }}
65+
strategy:
66+
fail-fast: false
67+
max-parallel: 5
68+
matrix: ${{ fromJSON(needs.nix-eval.outputs.matrix).x86_64_linux }}
69+
steps:
70+
- name: Checkout Repo
71+
uses: actions/checkout@v4
72+
- name: Install nix
73+
uses: ./.github/actions/nix-install-ephemeral
74+
env:
75+
DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }}
76+
NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }}
77+
- name: nix build
78+
shell: bash
79+
run: nix build --accept-flake-config -L .#${{ matrix.attr }}
7580

7681
run-testinfra:
77-
needs: [nix-build-aarch64-linux, nix-build-aarch64-darwin] #, nix-build-x86_64-linux]
82+
needs: [nix-build-aarch64-linux, nix-build-aarch64-darwin, nix-build-x86_64-linux]
7883
if: |
7984
!cancelled() &&
8085
(needs.nix-build-aarch64-linux.result == 'skipped' || needs.nix-build-aarch64-linux.result == 'success') &&
@@ -84,7 +89,7 @@ jobs:
8489
DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }}
8590

8691
run-tests:
87-
needs: [nix-build-aarch64-linux, nix-build-aarch64-darwin] #, nix-build-x86_64-linux]
92+
needs: [nix-build-aarch64-linux, nix-build-aarch64-darwin, nix-build-x86_64-linux]
8893
if: |
8994
!cancelled() &&
9095
(needs.nix-build-aarch64-linux.result == 'skipped' || needs.nix-build-aarch64-linux.result == 'success') &&

0 commit comments

Comments
 (0)