-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (89 loc) · 2.83 KB
/
ci.yml
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
102
name: 'Trustless Sidechain CI'
on:
pull_request:
push:
branches:
- master
- develop
workflow_dispatch:
env:
AWS_DEFAULT_REGION: eu-central-1
jobs:
build-x64-linux:
permissions:
id-token: write
contents: read
runs-on: [ self-hosted, Linux ]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ github.token }}
- name: Add signing key for nix
run: echo "${{ secrets.NIX_SIGNING_KEY }}" > "${{ runner.temp }}/nix-key"
- name: Run nixci to build all outputs
run: nix run github:srid/nixci -- -v build > /tmp/outputs
- name: Acquire AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Copy nix scopes to nix cache
run: |
nix-store --stdin -q --deriver < /tmp/outputs | nix-store --stdin -qR --include-outputs \
| nix copy --stdin --to \
"s3://cache.sc.iog.io?secret-key=${{ runner.temp }}/nix-key®ion=$AWS_DEFAULT_REGION" \
&& rm /tmp/outputs
test-x64-linux:
permissions:
id-token: write
contents: read
runs-on: [ self-hosted, Linux ]
needs:
- build-x64-linux
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ github.token }}
- name: Run tests
run: nix build .#check.x86_64-linux -L
build-arm64-darwin:
permissions:
id-token: write
contents: read
runs-on: [ self-hosted, macOS ]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ github.token }}
- name: Add signing key for nix
run: echo "${{ secrets.NIX_SIGNING_KEY }}" > "${{ runner.temp }}/nix-key"
- name: Run nixci to build all outputs
run: nix run github:srid/nixci -- -v build > /tmp/outputs
- name: Acquire AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Copy nix scopes to nix cache
run: |
nix-store --stdin -q --deriver < /tmp/outputs | nix-store --stdin -qR --include-outputs \
| nix copy --stdin --to \
"s3://cache.sc.iog.io?secret-key=${{ runner.temp }}/nix-key®ion=$AWS_DEFAULT_REGION" \
&& rm /tmp/outputs
test-arm64-darwin:
permissions:
id-token: write
contents: read
runs-on: [ self-hosted, macOS ]
needs:
- build-arm64-darwin
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ github.token }}
- name: Run tests
run: nix build .#check.aarch64-darwin -L