Skip to content

Commit

Permalink
specify msrv
Browse files Browse the repository at this point in the history
  • Loading branch information
icewind1991 committed Apr 7, 2024
1 parent dfd0b8a commit 8ff5e5e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 16 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ jobs:
authToken: '${{ secrets.ATTIC_TOKEN }}'
- run: nix build .#clippy

msrv:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- uses: icewind1991/attic-action@v1
with:
name: ci
instance: https://cache.icewind.me
authToken: '${{ secrets.ATTIC_TOKEN }}'
- run: nix build .#msrv

matrix:
runs-on: ubuntu-latest
outputs:
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/demostf/parser"
exclude = [ "tests/fuzz", "test_data" ]
default-run = "parse_demo"
rust-version = "1.70.0"

[lib]
name = "tf_demo_parser"
Expand Down
32 changes: 16 additions & 16 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
inherit system overlays;
};
lib = pkgs.lib;
inherit (builtins) listToAttrs fromTOML readFile;

hostTarget = pkgs.hostPlatform.config;
targets = [
Expand Down Expand Up @@ -62,6 +63,16 @@
};
hostNaersk = cross-naersk'.hostNaersk;

msrv = (fromTOML (readFile ./Cargo.toml)).package.rust-version;
msrvToolchain = pkgs.rust-bin.stable."${msrv}".default;
naerskMsrv = let
toolchain = msrvToolchain;
in
pkgs.callPackage naersk {
cargo = toolchain;
rustc = toolchain;
};

mkHydraJobs = system: {
parser = derivation {
name = "parser";
Expand Down Expand Up @@ -104,6 +115,10 @@
release = false;
mode = "test";
});
msrv = naerskMsrv.buildPackage (nearskOpt
// {
mode = "check";
});
default = demostf-parser;
};

Expand Down

0 comments on commit 8ff5e5e

Please sign in to comment.