Skip to content

Commit

Permalink
ci: remove actions-rs use nix to check
Browse files Browse the repository at this point in the history
  • Loading branch information
yanganto committed Apr 30, 2024
1 parent f046933 commit b94bc06
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,15 @@ jobs:
strategy:
fail-fast: false
matrix:
toolchain: [ nightly, beta, stable, 1.75.0 ]
toolchain: [ nightly, beta, stable, msrv ]
steps:
- uses: actions/checkout@v2
- name: Install rust ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
- name: All features
uses: actions-rs/cargo@v1
with:
command: check
args: --workspace --all-targets --all-features
- name: checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v5
- name: Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Check rgb-core
run: nix develop ".#${{ matrix.toolchain }}" -c cargo check --workspace --all-targets --all-features
85 changes: 85 additions & 0 deletions flake.lock

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

54 changes: 54 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};

flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, rust-overlay, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};

cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
in
with pkgs;
{
devShells = rec {
default = msrv;

msrv = mkShell {
buildInputs = [
rust-bin.stable."${cargoToml.package."rust-version"}".default
];
};

stable = mkShell {
buildInputs = [
rust-bin.stable.latest.default
];
};

beta = mkShell {
buildInputs = [
rust-bin.beta.latest.default
];
};

nightly = mkShell {
buildInputs = [
rust-bin.nightly.latest.default
];
};
};
}
);
}

0 comments on commit b94bc06

Please sign in to comment.