Skip to content

Commit f14ad33

Browse files
committed
split shell for ci
1 parent e01302b commit f14ad33

File tree

6 files changed

+73
-61
lines changed

6 files changed

+73
-61
lines changed

.github/workflows/dep_check.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ jobs:
2222
with:
2323
nix_path: nixpkgs=channel:nixos-unstable
2424

25+
- name: Update flake dependency
26+
run: nix flake update
27+
2528
- name: Update dependency
2629
id: update-dependency
27-
run: nix develop -c 'update-dependency'
30+
run: nix develop .#ci -c 'update-dependency'
2831

2932
- name: Create Pull Request
3033
if: failure() && steps.update-dependency.outcome != 'success'

.github/workflows/lint.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
github_access_token: ${{ secrets.GITHUB_TOKEN }}
1919

2020
- name: fmt
21-
run: nix develop -c cargo fmt
21+
run: nix develop .#ci -c cargo fmt
2222

2323
- name: Lint
2424
run: |
25-
nix develop -c cargo clippy -- -Dwarnings
26-
nix develop -c cargo clippy --no-default-features -- -Dwarnings
27-
nix develop -c cargo clippy --features=std -- -Dwarnings
28-
nix develop -c cargo clippy --features=merge -- -Dwarnings
29-
nix develop -c cargo clippy --features=option -- -Dwarnings
30-
nix develop -c cargo clippy --features=none_as_default -- -Dwarnings
31-
nix develop -c cargo clippy --features=keep_none -- -Dwarnings
32-
nix develop -c cargo clippy --features=nesting -- -Dwarnings
25+
nix develop .#ci -c cargo clippy -- -Dwarnings
26+
nix develop .#ci -c cargo clippy --no-default-features -- -Dwarnings
27+
nix develop .#ci -c cargo clippy --features=std -- -Dwarnings
28+
nix develop .#ci -c cargo clippy --features=merge -- -Dwarnings
29+
nix develop .#ci -c cargo clippy --features=option -- -Dwarnings
30+
nix develop .#ci -c cargo clippy --features=none_as_default -- -Dwarnings
31+
nix develop .#ci -c cargo clippy --features=keep_none -- -Dwarnings
32+
nix develop .#ci -c cargo clippy --features=nesting -- -Dwarnings

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
github_access_token: ${{ secrets.GITHUB_TOKEN }}
2525

2626
- name: Publish Crate
27-
run: nix develop -c 'crate-publish' ${{ secrets.CARGO_REGISTRY_TOKEN }}
27+
run: nix develop .#ci -c 'crate-publish' ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/test.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,46 +19,46 @@ jobs:
1919

2020
- name: Test no default features
2121
run: |
22-
nix develop -c cargo run --no-default-features --example instance
23-
nix develop -c cargo run --no-default-features --example filler
24-
nix develop -c cargo run --no-default-features --example diff
25-
nix develop -c cargo run --no-default-features --example json
26-
nix develop -c cargo run --no-default-features --example rename-patch-struct
27-
nix develop -c cargo run --no-default-features --example patch-attr
28-
nix develop -c cargo run --no-default-features --example time
29-
nix develop -c cargo run --no-default-features --features=nesting --example nesting
30-
nix develop -c cargo test --no-default-features
22+
nix develop .#ci -c cargo run --no-default-features --example instance
23+
nix develop .#ci -c cargo run --no-default-features --example filler
24+
nix develop .#ci -c cargo run --no-default-features --example diff
25+
nix develop .#ci -c cargo run --no-default-features --example json
26+
nix develop .#ci -c cargo run --no-default-features --example rename-patch-struct
27+
nix develop .#ci -c cargo run --no-default-features --example patch-attr
28+
nix develop .#ci -c cargo run --no-default-features --example time
29+
nix develop .#ci -c cargo run --no-default-features --features=nesting --example nesting
30+
nix develop .#ci -c cargo test --no-default-features
3131
3232
- name: Test with std features
3333
run: |
34-
nix develop -c cargo run --features=std --example instance
35-
nix develop -c cargo run --features=std --example filler
36-
nix develop -c cargo run --features=std --example diff
37-
nix develop -c cargo run --features=std --example json
38-
nix develop -c cargo run --features=std --example rename-patch-struct
39-
nix develop -c cargo run --features=std --example patch-attr
40-
nix develop -c cargo run --features=std --example option
41-
nix develop -c cargo run --features=std,nesting --example nesting
42-
nix develop -c cargo test --features=std
34+
nix develop .#ci -c cargo run --features=std --example instance
35+
nix develop .#ci -c cargo run --features=std --example filler
36+
nix develop .#ci -c cargo run --features=std --example diff
37+
nix develop .#ci -c cargo run --features=std --example json
38+
nix develop .#ci -c cargo run --features=std --example rename-patch-struct
39+
nix develop .#ci -c cargo run --features=std --example patch-attr
40+
nix develop .#ci -c cargo run --features=std --example option
41+
nix develop .#ci -c cargo run --features=std,nesting --example nesting
42+
nix develop .#ci -c cargo test --features=std
4343
4444
- name: Test with merge features
4545
run: |
46-
nix develop -c cargo run --features=option --features=merge --example option
47-
nix develop -c cargo run --features=merge --example op
48-
nix develop -c cargo run --features=merge,nesting --example nesting
49-
nix develop -c cargo test --features=merge --no-default-features
50-
nix develop -c cargo test --features=merge
46+
nix develop .#ci -c cargo run --features=option --features=merge --example option
47+
nix develop .#ci -c cargo run --features=merge --example op
48+
nix develop .#ci -c cargo run --features=merge,nesting --example nesting
49+
nix develop .#ci -c cargo test --features=merge --no-default-features
50+
nix develop .#ci -c cargo test --features=merge
5151
5252
- name: Test with option features
5353
run: |
54-
nix develop -c cargo run --features=none_as_default --example option
55-
nix develop -c cargo run --features=none_as_default,nesting --example nesting
56-
nix develop -c cargo run --features=keep_none --example option
57-
nix develop -c cargo run --features=keep_none,nesting --example nesting
54+
nix develop .#ci -c cargo run --features=none_as_default --example option
55+
nix develop .#ci -c cargo run --features=none_as_default,nesting --example nesting
56+
nix develop .#ci -c cargo run --features=keep_none --example option
57+
nix develop .#ci -c cargo run --features=keep_none,nesting --example nesting
5858
5959
- name: Test with default features
6060
run: |
61-
nix develop -c cargo run --example status
62-
nix develop -c cargo run --example op
63-
nix develop -c cargo run --features=nesting --example nesting
64-
nix develop -c cargo test
61+
nix develop .#ci -c cargo run --example status
62+
nix develop .#ci -c cargo run --example op
63+
nix develop .#ci -c cargo run --features=nesting --example nesting
64+
nix develop .#ci -c cargo test

flake.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
pkgs = import nixpkgs {
1515
inherit system overlays;
1616
};
17-
rust = pkgs.rust-bin.stable.latest.default;
1817
dr = dependency-refresh.defaultPackage.${system};
1918

2019
publishScript = pkgs.writeShellScriptBin "crate-publish" ''
@@ -33,16 +32,26 @@
3332
in
3433
with pkgs;
3534
{
36-
devShell = mkShell {
37-
buildInputs = [
38-
rust
39-
openssl
40-
pkg-config
35+
devShells = {
36+
default = mkShell {
37+
buildInputs = [
38+
rust-bin.stable.latest.minimal
39+
openssl
40+
pkg-config
41+
];
42+
};
4143

42-
dr
43-
publishScript
44-
updateDependencyScript
45-
];
44+
ci = mkShell {
45+
buildInputs = [
46+
rust-bin.stable.latest.default
47+
openssl
48+
pkg-config
49+
50+
dr
51+
publishScript
52+
updateDependencyScript
53+
];
54+
};
4655
};
4756
}
4857
);

0 commit comments

Comments
 (0)