-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (53 loc) · 1.73 KB
/
build.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
# Workflow file to validate that builds work.
# Normally we'd trust that `cargo check` and friends are sufficient
# for building, but due to the complicated nature of the build.rs
# statically linking in a C lib, we want to ensure that two scenarios work:
#
# 1. Naive `cargo build` with go on path.
# 2. `nix build` which is strict about inputs and outputs.
#
# If both of those setups work, then we've defined the build adequatedly.
name: build
on:
pull_request:
jobs:
cargo:
name: cargo build
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: install nix
uses: nixbuild/nix-quick-install-action@v28
- name: setup nix cache
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
backend: buildjet
- name: Load rust cache
uses: astriaorg/buildjet-rust-cache@v2.5.1
- name: run cargo build
run: >-
nix develop --command
cargo build --release
nix:
name: nix build
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: install nix
uses: nixbuild/nix-quick-install-action@v28
- name: setup nix cache
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
backend: buildjet
- name: load rust cache
uses: astriaorg/buildjet-rust-cache@v2.5.1
- name: run nix build
run: nix build