mirror of
https://github.com/Swatinem/rust-cache
synced 2025-12-16 18:09:15 +00:00
Add a test
This commit is contained in:
parent
a47c521c3c
commit
4bcebbedb5
2 changed files with 56 additions and 0 deletions
33
.github/workflows/nix.yml
vendored
Normal file
33
.github/workflows/nix.yml
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
name: nix
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
nix:
|
||||
if: github.repository == 'Swatinem/rust-cache'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
|
||||
name: Test Nix on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- uses: cachix/install-nix-action@7e5978947b7efba56e96c43fd785691980aca924 # v31.8.4
|
||||
|
||||
- uses: ./
|
||||
with:
|
||||
workspaces: tests
|
||||
cmd-format: nix develop tests -c {0}
|
||||
|
||||
- run: |
|
||||
nix develop -c cargo check --color always
|
||||
nix develop -c cargo test --color always
|
||||
working-directory: tests
|
||||
23
tests/flake.nix
Normal file
23
tests/flake.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ { self, nixpkgs, flake-utils, rust-overlay, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system: let
|
||||
overlays = [ (import rust-overlay) ];
|
||||
pkgs = import nixpkgs { inherit system overlays; };
|
||||
in {
|
||||
devShells.default = with pkgs; mkShell {
|
||||
buildInputs = [ rust-bin.stable.latest.minimal ];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue