-
Notifications
You must be signed in to change notification settings - Fork 1
142 lines (118 loc) · 3.56 KB
/
default.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Check and build
on: [ "push", "pull_request" ]
env:
CARGO_TERM_COLOR: always
permissions:
id-token: "write"
contents: "read"
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Configure Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check Nix inputs
uses: DeterminateSystems/flake-checker-action@main
with:
fail-mode: true
- name: Load environment
run: |
nix develop --command \
echo "All fine"
check:
needs: [ "prepare" ]
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Configure Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check Nix inputs
uses: DeterminateSystems/flake-checker-action@main
with:
fail-mode: true
- name: Setup rust cache
uses: actions/cache@v4
with:
key: cargo-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-${{ runner.os }}-build-${{ env.cache-name }}-
cargo-${{ runner.os }}-build-
cargo-${{ runner.os }}-
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
- name: Check Formatting
run: |
nix develop --command \
cargo fmt --all -- --check
- name: Check Clippy
run: |
nix develop --command \
cargo clippy
- name: Check dependency usage
run: |
nix develop --command \
cargo machete
- name: Audit rust dependencies
run: |
nix develop --command \
cargo deny check
build:
runs-on: ubuntu-latest
needs: [ "check" ]
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Configure Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Setup rust cache
uses: actions/cache@v4
with:
key: cargo-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-${{ runner.os }}-build-${{ env.cache-name }}-
cargo-${{ runner.os }}-build-
cargo-${{ runner.os }}-
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
- name: Build
run: |
nix develop --command \
cargo build --all --verbose
- name: Run tests
run: |
nix develop --command \
cargo test --all --verbose
- name: Run miri
run: |
nix develop --command \
cargo miri test
env:
MIRIFLAGS: -Zmiri-strict-provenance
package:
runs-on: ubuntu-latest
needs: [ "check" ]
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Configure Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build package
run: |
nix build .#photonic