-
Notifications
You must be signed in to change notification settings - Fork 1
119 lines (109 loc) · 3.91 KB
/
ci.yaml
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
name: Main CI
on:
pull_request:
workflow_call:
push:
branches:
- main
tags:
- "**"
jobs:
fmt:
name: Format
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
- uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac # pin@v22
- uses: cachix/cachix-action@6a9a34cdd93d0ae4b4b59fd678660efb08109f2f # pin@v12
continue-on-error: true
with:
name: worldcoin
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Check Rust formatting
run: cargo fmt --check --all
- name: Check Nix formatting
run: |
nix develop -c \
nixpkgs-fmt --check flake.nix
- name: Check Protobuf formatting
run: |
nix develop -c \
clang-format messages/**/*.proto --Werror --dry-run
clippy:
name: Clippy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
- uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac # pin@v22
- uses: cachix/cachix-action@6a9a34cdd93d0ae4b4b59fd678660efb08109f2f # pin@v12
continue-on-error: true
with:
name: worldcoin
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # pin@v2
- name: Clippy lints
run: |
nix develop -c \
cargo clippy --all --all-features --all-targets --no-deps -- -D warnings
doc:
name: Doc
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
- uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac # pin@v22
- uses: cachix/cachix-action@6a9a34cdd93d0ae4b4b59fd678660efb08109f2f # pin@v12
continue-on-error: true
with:
name: worldcoin
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # pin@v2
- name: Cargo Doc
run: |
nix develop -c \
cargo doc --all --all-features --no-deps --document-private-items
test:
name: Test
strategy:
matrix:
platform: [ubuntu-22.04]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
- uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac # pin@v22
- uses: cachix/cachix-action@6a9a34cdd93d0ae4b4b59fd678660efb08109f2f # pin@v12
continue-on-error: true
with:
name: worldcoin
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # pin@v2
- name: Configure cargo to exclude platform-specific crates
if: ${{ matrix.platform == 'macos-13' }}
run: |
MAC_EXCLUDE=(
)
echo MAC_EXCLUDE="${MAC_EXCLUDE[*]}" >>${GITHUB_ENV}
cat ${GITHUB_ENV}
- name: Cargo Test
run: |
uname -a
nix develop -c env
nix develop -c \
cargo test --all --all-features --all-targets $MAC_EXCLUDE
cargo-deny:
name: Check licensing
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
- uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac # pin@v22
- uses: cachix/cachix-action@6a9a34cdd93d0ae4b4b59fd678660efb08109f2f # pin@v12
continue-on-error: true
with:
name: worldcoin
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Check licenses and security advisories
run: |
nix develop -c \
cargo deny check