ci: also use fast-flake-check for examples (#433)

This commit is contained in:
Ivan Petkov 2023-10-17 02:56:16 +00:00 committed by GitHub
parent f2b70c85d5
commit ff6e2c1f24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 7 deletions

View File

@ -45,7 +45,7 @@ jobs:
name: crane
authToken: ${{ github.ref == 'refs/heads/master' && secrets.CACHIX_AUTH_TOKEN || '' }}
- name: flake checks
run: nix develop --accept-flake-config --command ./ci/fast-flake-check.sh ${{ matrix.nixpkgs-override }} -- --keep-going
run: nix develop --accept-flake-config --command ./ci/fast-flake-check.sh ${{ matrix.nixpkgs-override }}
- name: extra tests
run: nix develop --accept-flake-config ${{ matrix.nixpkgs-override }} --command ./extra-tests/test.sh
@ -87,8 +87,9 @@ jobs:
for f in $(find examples -maxdepth 1 -mindepth 1 -type d ${{ matrix.filter }} | sort -u); do
pushd "${f}"
echo "validating ${f}"
# NB: check the entire flake here, not just `.#checks`
nix flake check --accept-flake-config --print-build-logs --override-input crane ../.. ${{ matrix.nixpkgs-override }}
nix develop ../..# --accept-flake-config --command ../../ci/fast-flake-check.sh --override-input crane ../.. ${{ matrix.nixpkgs-override }}
# NB: evaluate the rest flake here, but don't build anything
nix flake check --no-build --accept-flake-config --print-build-logs --override-input crane ../.. ${{ matrix.nixpkgs-override }}
popd
done

View File

@ -2,7 +2,7 @@
curSystem=$(nix eval --raw --impure --expr builtins.currentSystem)
nixEvalJobsArgs=()
while [[ $# -ge 0 ]]; do
while [[ $# -gt 0 ]]; do
arg="$1"
shift 1

View File

@ -32,9 +32,8 @@
];
craneLib = (crane.mkLib pkgs).overrideToolchain toolchain;
in
{
packages.default = craneLib.buildPackage {
my-crate = craneLib.buildPackage {
src = craneLib.cleanCargoSource (craneLib.path ./.);
strictDeps = true;
@ -47,6 +46,16 @@
pkgsCross.mingwW64.windows.pthreads
];
};
in
{
packages = {
inherit my-crate;
default = my-crate;
};
checks = {
inherit my-crate;
};
}
);
}