Skip to content

Commit 4bcebbe

Browse files
committed
Add a test
1 parent a47c521 commit 4bcebbe

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/workflows/nix.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: nix
2+
3+
on: [push, pull_request]
4+
5+
permissions: {}
6+
7+
jobs:
8+
nix:
9+
if: github.repository == 'Swatinem/rust-cache'
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: [ubuntu-latest, macos-latest]
14+
15+
name: Test Nix on ${{ matrix.os }}
16+
runs-on: ${{ matrix.os }}
17+
18+
steps:
19+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
20+
with:
21+
persist-credentials: false
22+
23+
- uses: cachix/install-nix-action@7e5978947b7efba56e96c43fd785691980aca924 # v31.8.4
24+
25+
- uses: ./
26+
with:
27+
workspaces: tests
28+
cmd-format: nix develop tests -c {0}
29+
30+
- run: |
31+
nix develop -c cargo check --color always
32+
nix develop -c cargo test --color always
33+
working-directory: tests

tests/flake.nix

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
rust-overlay = {
6+
url = "github:oxalica/rust-overlay";
7+
inputs.nixpkgs.follows = "nixpkgs";
8+
};
9+
};
10+
11+
outputs = inputs @ { self, nixpkgs, flake-utils, rust-overlay, ... }:
12+
flake-utils.lib.eachDefaultSystem (
13+
system: let
14+
overlays = [ (import rust-overlay) ];
15+
pkgs = import nixpkgs { inherit system overlays; };
16+
in {
17+
devShells.default = with pkgs; mkShell {
18+
buildInputs = [ rust-bin.stable.latest.minimal ];
19+
};
20+
}
21+
);
22+
}
23+

0 commit comments

Comments
 (0)