-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (64 loc) · 1.74 KB
/
nix.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
name: check with nix
on:
push:
branches:
- "master"
tags:
- "*"
pull_request:
jobs:
check-nix:
name: Check
runs-on: ubuntu-22.04
steps:
- name: git checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check Nixpkgs inputs
uses: DeterminateSystems/flake-checker-action@main
with:
fail-mode: true
# Nix-specific logic begins here
- name: Check Rust formatting
run: |
nix develop --command \
cargo fmt --check
- name: editorconfig check
run: |
nix develop --command \
eclint \
-exclude "Cargo.lock"
- name: Check spelling
run: |
nix develop --command \
codespell \
--skip target,.git \
--ignore-words-list crate
build-and-test-nix:
needs: check-nix
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
runs-on: ${{ matrix.os }}
steps:
- name: git checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Set up Rust cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Test
run: |
nix develop --command \
env RUSTFLAGS="-Clink-arg=-Wl,--build-id" cargo test