-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (49 loc) · 1.46 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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v28
with:
github_access_token: ${{ secrets.PAT }}
nix_conf: |
netrc-file = /home/runner/.netrc
- uses: bcomnes/netrc-creds@v3
with:
creds: |
[
{
"machine": "github.com",
"login": "git",
"password": "${{ secrets.PAT }}"
},
{
"machine": "api.github.com",
"login": "git",
"password": "${{ secrets.PAT }}"
}
]
- name: Setup Cache
uses: DeterminateSystems/magic-nix-cache-action@v8
- uses: Swatinem/rust-cache@v2
- name: Eval Devshell
run: nix-instantiate shell.nix --add-root shell
- name: Check Format
run: nix-shell shell --run "treefmt --ci"
- name: Lint
run: nix-shell shell --run "cargo clippy -- -D warnings && cargo clippy --no-default-features -- -D warnings"
- name: Run Tests
run: nix-shell shell --run "cargo test --all && cargo test --all --no-default-features"