-
Notifications
You must be signed in to change notification settings - Fork 29
93 lines (87 loc) · 2.8 KB
/
Copy pathcode-lint.yaml
File metadata and controls
93 lines (87 loc) · 2.8 KB
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
name: Code Linter
on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']
push:
branches:
- develop
- 'release/**'
env:
CI: 1
jobs:
rust-lint:
strategy:
matrix:
os: [github-arm64-2c-8gb, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- run: |
echo "NIX_PATH=nixpkgs=$(jq -r '.nixpkgs.url' nix/sources.json)" >> $GITHUB_ENV
- uses: cachix/install-nix-action@v31
with:
nix_path: ${{ env.NIX_PATH }}
- run: nix-build shell.nix
- name: cargo-fmt
run: nix-shell --pure --run "FMT_OPTS=--check ./scripts/rust-style.sh"
- name: cargo-clippy
run: nix-shell --pure --run ./scripts/rust-linter.sh
rust-dev:
strategy:
matrix:
os: [github-arm64-2c-8gb, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- run: |
echo "NIX_PATH=nixpkgs=$(jq -r '.nixpkgs.url' nix/sources.json)" >> $GITHUB_ENV
- uses: cachix/install-nix-action@v31
with:
nix_path: ${{ env.NIX_PATH }}
- run: |
echo "SPDK_REV=$(nix-instantiate --eval -A libspdk.rev | cut -d '"' -f2)" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
submodules: 'recursive'
repository: ${{ github.repository_owner }}/spdk
path: 'spdk'
ref: ${{ env.SPDK_REV }}
- run: nix-build shell.nix --argstr spdk-path ./spdk
- run: nix-shell --argstr spdk-path spdk --run "./build_scripts/build_spdk.sh configure -t $(uname -m)-unknown-linux-gnu"
- run: nix-shell --argstr spdk-path spdk --run "./build_scripts/build_spdk.sh make"
- run: nix-shell --argstr spdk-path spdk --run "cargo build --all --examples"
- run: sudo sysctl -w vm.nr_hugepages=512
- run: sudo -E ./target/debug/examples/hello_world
if: ${{ matrix.os != 'github-arm64-2c-8gb' }}
# - name: Setup tmate session
# if: ${{ failure() }}
# timeout-minutes: 120
# uses: mxschmitt/action-tmate@v3
nix-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- run: |
echo "NIX_PATH=nixpkgs=$(jq -r '.nixpkgs.url' nix/sources.json)" >> $GITHUB_ENV
- uses: cachix/install-nix-action@v31
with:
nix_path: ${{ env.NIX_PATH }}
- name: nix-shell
run: nix-shell --pure -p nixpkgs-fmt --run "nixpkgs-fmt --check ."
code-lint:
if: always()
needs:
- rust-lint
- rust-dev
- nix-lint
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}