add(ci): check for msrv (#1522)
This commit is contained in:
parent
464f21aebd
commit
641c5a34d4
2 changed files with 53 additions and 2 deletions
23
.github/workflows/nix.yml
vendored
23
.github/workflows/nix.yml
vendored
|
|
@ -13,7 +13,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: "nix build"
|
name: "nix build"
|
||||||
environment: cachix
|
environment: cachix
|
||||||
timeout-minutes: 25
|
timeout-minutes: 35
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
|
@ -27,3 +27,24 @@ jobs:
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
- run: |
|
- run: |
|
||||||
nix build || nix build --substituters 'https://cache.nixos.org' --extra-substituters ''
|
nix build || nix build --substituters 'https://cache.nixos.org' --extra-substituters ''
|
||||||
|
build-msrv:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: "build msrv"
|
||||||
|
environment: cachix
|
||||||
|
timeout-minutes: 35
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
# Nix Flakes doesn't work on shallow clones
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: cachix/install-nix-action@v17
|
||||||
|
- uses: cachix/cachix-action@v10
|
||||||
|
with:
|
||||||
|
name: zellij
|
||||||
|
# If you chose API tokens for write access OR if you have a private cache
|
||||||
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
|
- run: |
|
||||||
|
nix build .#zellij-msrv || nix build .#zellij-msrv --substituters 'https://cache.nixos.org' --extra-substituters ''
|
||||||
|
- if: ${{ failure() }}
|
||||||
|
run: |
|
||||||
|
echo "::error :: If this is the only ci step failing, it is likely that the MSRV needs to be bumped.
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,16 @@ flake-utils.lib.eachSystem [
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
crate2nixMsrvPkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [
|
||||||
|
(self: _: {
|
||||||
|
rustc = msrvToolchain;
|
||||||
|
cargo = msrvToolchain;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
name = "zellij";
|
name = "zellij";
|
||||||
pname = name;
|
pname = name;
|
||||||
root = self;
|
root = self;
|
||||||
|
|
@ -40,9 +50,16 @@ flake-utils.lib.eachSystem [
|
||||||
|
|
||||||
src = pkgs.nix-gitignore.gitignoreSource ignoreSource root;
|
src = pkgs.nix-gitignore.gitignoreSource ignoreSource root;
|
||||||
|
|
||||||
cargoToml = builtins.fromTOML (builtins.readFile (src + ./Cargo.toml));
|
cargoToml = builtins.fromTOML (builtins.readFile (src + "/Cargo.toml"));
|
||||||
|
toolchainToml = builtins.fromTOML (builtins.readFile (src + "/rust-toolchain.toml"));
|
||||||
rustToolchainToml = pkgs.rust-bin.fromRustupToolchainFile (src + "/rust-toolchain.toml");
|
rustToolchainToml = pkgs.rust-bin.fromRustupToolchainFile (src + "/rust-toolchain.toml");
|
||||||
|
|
||||||
|
msrvToolchain = pkgs.rust-bin.fromRustupToolchain {
|
||||||
|
channel = cargoToml.package.rust-version;
|
||||||
|
components = toolchainToml.toolchain.components;
|
||||||
|
targets = toolchainToml.toolchain.targets;
|
||||||
|
};
|
||||||
|
|
||||||
cargoLock = {
|
cargoLock = {
|
||||||
lockFile = builtins.path {
|
lockFile = builtins.path {
|
||||||
path = src + "/Cargo.lock";
|
path = src + "/Cargo.lock";
|
||||||
|
|
@ -160,6 +177,19 @@ in rec {
|
||||||
nativeBuildInputs = nativeBuildInputs ++ defaultPlugins;
|
nativeBuildInputs = nativeBuildInputs ++ defaultPlugins;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
packages.zellij-msrv = crate2nixMsrvPkgs.callPackage ./crate2nix.nix {
|
||||||
|
inherit
|
||||||
|
name
|
||||||
|
src
|
||||||
|
crate2nix
|
||||||
|
desktopItems
|
||||||
|
postInstall
|
||||||
|
patchPhase
|
||||||
|
meta
|
||||||
|
;
|
||||||
|
nativeBuildInputs = nativeBuildInputs ++ defaultPlugins;
|
||||||
|
};
|
||||||
|
|
||||||
# native nixpkgs support - keep supported
|
# native nixpkgs support - keep supported
|
||||||
packages.zellij-native = (pkgs.makeRustPlatform {inherit cargo rustc;}).buildRustPackage {
|
packages.zellij-native = (pkgs.makeRustPlatform {inherit cargo rustc;}).buildRustPackage {
|
||||||
inherit
|
inherit
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue