Skip to content

Commit 883b13a

Browse files
authored
Merge pull request #91 from openebs/gha-push
Run CI on push and also test local dev build
2 parents 9851d84 + d2cd15e commit 883b13a

File tree

6 files changed

+82
-45
lines changed

6 files changed

+82
-45
lines changed

.github/workflows/code-lint.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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: nix-shell --argstr spdk-path spdk --run "./build_scripts/build_spdk.sh configure -t $(uname -m)-unknown-linux-gnu"
59+
- run: nix-shell --argstr spdk-path spdk --run "./build_scripts/build_spdk.sh make"
60+
- run: nix-shell --argstr spdk-path spdk --run "cargo build --all"
61+
# - name: Setup tmate session
62+
# if: ${{ failure() }}
63+
# timeout-minutes: 120
64+
# uses: mxschmitt/action-tmate@v3
65+
66+
nix-lint:
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v4
70+
with:
71+
submodules: 'recursive'
72+
- run: |
73+
echo "NIX_PATH=nixpkgs=$(jq -r '.nixpkgs.url' nix/sources.json)" >> $GITHUB_ENV
74+
- uses: cachix/install-nix-action@v31
75+
with:
76+
nix_path: ${{ env.NIX_PATH }}
77+
- name: nix-shell
78+
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.

nix/overlay.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{}:
21
final: prev: rec {
32
fio = prev.callPackage ./pkgs/fio { };
43
astyle = prev.callPackage ./pkgs/astyle { };

nix/pkgs/libspdk/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ let
9797
drvAttrs = rec {
9898
pname = spdk.pname;
9999
version = spdk.version;
100+
rev = spdk.rev;
100101

101102
src = [
102103
(fetchFromGitHub {

shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let
88
pkgs = import sources.nixpkgs {
99
overlays = [
1010
(_: _: { inherit sources; })
11-
(import ./nix/overlay.nix { })
11+
(import ./nix/overlay.nix)
1212
];
1313
};
1414

0 commit comments

Comments
 (0)