Skip to content

Commit fb66471

Browse files
ci: build as local dev
Do a local dev build on CI to ensure we don't break this. Signed-off-by: Tiago Castro <[email protected]>
1 parent a02986f commit fb66471

File tree

3 files changed

+82
-43
lines changed

3 files changed

+82
-43
lines changed

.github/workflows/code-lint.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Code Linter
2+
3+
on:
4+
pull_request:
5+
types: ['opened', 'edited', 'reopened', 'synchronize']
6+
push:
7+
branches:
8+
- develop
9+
- 'release/**'
10+
11+
env:
12+
CI: 1
13+
14+
jobs:
15+
rust-lint:
16+
strategy:
17+
matrix:
18+
os: [github-arm64-2c-8gb, ubuntu-latest]
19+
runs-on: ${{ matrix.os }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
submodules: 'recursive'
24+
- run: |
25+
echo "NIX_PATH=nixpkgs=$(jq -r '.nixpkgs.url' nix/sources.json)" >> $GITHUB_ENV
26+
- uses: cachix/install-nix-action@v31
27+
with:
28+
nix_path: ${{ env.NIX_PATH }}
29+
- run: nix-build shell.nix
30+
- name: cargo-fmt
31+
run: nix-shell --pure --run "FMT_OPTS=--check ./scripts/rust-style.sh"
32+
- name: cargo-clippy
33+
run: nix-shell --pure --run ./scripts/rust-linter.sh
34+
35+
rust-dev:
36+
strategy:
37+
matrix:
38+
os: [github-arm64-2c-8gb, ubuntu-latest]
39+
runs-on: ${{ matrix.os }}
40+
steps:
41+
- uses: actions/checkout@v4
42+
with:
43+
submodules: 'recursive'
44+
- run: |
45+
echo "NIX_PATH=nixpkgs=$(jq -r '.nixpkgs.url' nix/sources.json)" >> $GITHUB_ENV
46+
- uses: cachix/install-nix-action@v31
47+
with:
48+
nix_path: ${{ env.NIX_PATH }}
49+
- run: |
50+
echo "SPDK_REV=$(nix-instantiate --eval -A libspdk.rev | cut -d '"' -f2)" >> $GITHUB_ENV
51+
- uses: actions/checkout@v4
52+
with:
53+
submodules: 'recursive'
54+
repository: ${{ github.repository_owner }}/spdk
55+
path: 'spdk'
56+
ref: ${{ env.SPDK_REV }}
57+
- run: nix-build shell.nix --argstr spdk-path ./spdk
58+
- run: |
59+
target="$(uname -m)-unknown-linux-gnu"
60+
nix-shell --argstr spdk-path spdk --run "./build_scripts/build_spdk.sh configure -t $target"
61+
- run: nix-shell --argstr spdk-path spdk --run "./build_scripts/build_spdk.sh make"
62+
- run: nix-shell --argstr spdk-path spdk --run "cargo build --all"
63+
# - name: Setup tmate session
64+
# if: ${{ failure() }}
65+
# timeout-minutes: 120
66+
# uses: mxschmitt/action-tmate@v3
67+
68+
nix-lint:
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v4
72+
with:
73+
submodules: 'recursive'
74+
- run: |
75+
echo "NIX_PATH=nixpkgs=$(jq -r '.nixpkgs.url' nix/sources.json)" >> $GITHUB_ENV
76+
- uses: cachix/install-nix-action@v31
77+
with:
78+
nix_path: ${{ env.NIX_PATH }}
79+
- name: nix-shell
80+
run: nix-shell --pure -p nixpkgs-fmt --run "nixpkgs-fmt --check ."

.github/workflows/pr-commitlint.yml renamed to .github/workflows/commitlint.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
name: Lint Commit Messages
2+
23
on:
34
pull_request:
45
types: ['opened', 'edited', 'reopened', 'synchronize']
5-
push:
6-
branches:
7-
- staging
86

97
jobs:
108
commitlint:
119
runs-on: ubuntu-latest
1210
steps:
13-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1412
with:
1513
fetch-depth: 0
1614
- name: Install CommitLint and Dependencies

.github/workflows/pr-code-lint.yaml

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)