Skip to content

Commit 9ab0387

Browse files
jfrocheyvan-sraka
authored andcommitted
feat: enable x86_64-linux builds in CI
1 parent 45eea90 commit 9ab0387

File tree

2 files changed

+37
-38
lines changed

2 files changed

+37
-38
lines changed
Lines changed: 4 additions & 13 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,9 +28,3 @@ runs:
3128
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}
3229
aws_session_token = ${AWS_SESSION_TOKEN}
3330
EOF
34-
- name: Build psql bundle
35-
run: >
36-
nix build ".#checks.$(nix eval --raw --impure --expr 'builtins.currentSystem')"
37-
- name: nix build
38-
shell: bash
39-
run: nix build --accept-flake-config -L .#${{ inputs.attr }}

.github/workflows/nix-build.yml

Lines changed: 33 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,37 @@ 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: Build psql bundle
78+
run: >
79+
nix build ".#checks.$(nix eval --raw --impure --expr 'builtins.currentSystem')"
80+
- name: nix build
81+
shell: bash
82+
run: nix build --accept-flake-config -L .#${{ matrix.attr }}
7583

7684
run-testinfra:
77-
needs: [nix-build-aarch64-linux, nix-build-aarch64-darwin] #, nix-build-x86_64-linux]
85+
needs: [nix-build-aarch64-linux, nix-build-aarch64-darwin, nix-build-x86_64-linux]
7886
if: |
7987
!cancelled() &&
8088
(needs.nix-build-aarch64-linux.result == 'skipped' || needs.nix-build-aarch64-linux.result == 'success') &&
@@ -84,7 +92,7 @@ jobs:
8492
DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }}
8593

8694
run-tests:
87-
needs: [nix-build-aarch64-linux, nix-build-aarch64-darwin] #, nix-build-x86_64-linux]
95+
needs: [nix-build-aarch64-linux, nix-build-aarch64-darwin, nix-build-x86_64-linux]
8896
if: |
8997
!cancelled() &&
9098
(needs.nix-build-aarch64-linux.result == 'skipped' || needs.nix-build-aarch64-linux.result == 'success') &&

0 commit comments

Comments
 (0)