forked from Defelo/nixpkgs-review-gha
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (93 loc) · 3.09 KB
/
build.yml
File metadata and controls
101 lines (93 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: build
run-name: "build ${{ inputs.packages }}"
permissions: {}
on:
workflow_dispatch:
inputs:
packages:
description: "Packages"
required: false
type: string
x86_64-linux:
description: "Build on x86_64-linux"
required: true
type: boolean
default: true
aarch64-linux:
description: "Build on aarch64-linux"
required: true
type: boolean
default: true
x86_64-darwin:
description: "Build on x86_64-darwin"
required: true
type: choice
default: yes_sandbox_relaxed
options:
- "no"
- yes_sandbox_false
- yes_sandbox_relaxed
- yes_sandbox_true
aarch64-darwin:
description: "Build on aarch64-darwin"
required: true
type: choice
default: yes_sandbox_relaxed
options:
- "no"
- yes_sandbox_false
- yes_sandbox_relaxed
- yes_sandbox_true
upterm:
description: "Start upterm session after nix build"
required: true
type: boolean
default: false
jobs:
build:
strategy:
fail-fast: false
matrix:
system:
- x86_64-linux
- aarch64-linux
- x86_64-darwin
- aarch64-darwin
exclude:
- system: ${{ !inputs.x86_64-linux && 'x86_64-linux' || '' }}
- system: ${{ !inputs.aarch64-linux && 'aarch64-linux' || '' }}
- system: ${{ inputs.x86_64-darwin == 'no' && 'x86_64-darwin' || '' }}
- system: ${{ inputs.aarch64-darwin == 'no' && 'aarch64-darwin' || '' }}
runs-on: >-
${{ (matrix.system == 'x86_64-linux' && 'ubuntu-latest')
|| (matrix.system == 'aarch64-linux' && 'ubuntu-24.04-arm')
|| (matrix.system == 'x86_64-darwin' && 'macos-latest')
|| (matrix.system == 'aarch64-darwin' && 'macos-latest') }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: .github/actions
- name: setup nix
uses: ./.github/actions/setup-nix
with:
extra-nix-config: ${{ vars.EXTRA_NIX_CONFIG }}
system: ${{ matrix.system }}
sandbox: ${{
(matrix.system == 'x86_64-darwin' && inputs.x86_64-darwin == 'yes_sandbox_false'
|| matrix.system == 'aarch64-darwin' && inputs.aarch64-darwin == 'yes_sandbox_false') && 'false'
|| (matrix.system == 'x86_64-darwin' && inputs.x86_64-darwin == 'yes_sandbox_relaxed'
|| matrix.system == 'aarch64-darwin' && inputs.aarch64-darwin == 'yes_sandbox_relaxed') && 'relaxed'
|| 'true' }}
- name: nix build
run: nix build --keep-going -L ${{ inputs.packages }}
if: ${{ inputs.packages != '' }}
- name: set GITHUB_TOKEN
if: ${{ inputs.upterm }}
run: echo "GITHUB_TOKEN=${GITHUB_TOKEN}" >> "$GITHUB_ENV"
env:
GITHUB_TOKEN: ${{ github.token }}
- name: start upterm session
if: ${{ inputs.upterm }}
uses: owenthereal/action-upterm@v1
with:
limit-access-to-actor: true