.gitea/workflows/build-and-test: run tests in separate step
This commit is contained in:
@@ -61,3 +61,24 @@ jobs:
|
||||
path: result/
|
||||
if-no-files-found: error
|
||||
retention-days: 15
|
||||
|
||||
test:
|
||||
runs-on: debian-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install sudo
|
||||
run: apt-get update && apt-get -y install sudo
|
||||
|
||||
- name: Install nix
|
||||
uses: https://github.com/cachix/install-nix-action@v31
|
||||
with:
|
||||
extra_nix_config: |
|
||||
show-trace = true
|
||||
max-jobs = auto
|
||||
trusted-users = root
|
||||
experimental-features = nix-command flakes
|
||||
build-users-group =
|
||||
|
||||
- name: Build
|
||||
run: nix build .#tamerye-tests -L
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
inherit src;
|
||||
|
||||
strictDeps = true;
|
||||
doCheck = false;
|
||||
|
||||
cargoArtifacts = craneLib.buildDepsOnly {
|
||||
inherit src;
|
||||
@@ -86,7 +87,9 @@
|
||||
pname = "tamerye-static-lib";
|
||||
version = cargoToml.package.version;
|
||||
inherit src;
|
||||
|
||||
strictDeps = true;
|
||||
doCheck = false;
|
||||
|
||||
postPatch = ''
|
||||
'${lib.getExe pkgs.yq-go}' '.lib.crate-type = [ "staticlib" ]' --inplace Cargo.toml
|
||||
@@ -107,6 +110,32 @@
|
||||
|
||||
cargoExtraArgs = lib.escapeShellArgs [ "--features" "static" ];
|
||||
};
|
||||
|
||||
tamerye-tests = craneLib.cargoNextest {
|
||||
pname = "tamerye-tests";
|
||||
version = cargoToml.package.version;
|
||||
inherit src;
|
||||
strictDeps = true;
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
sqlite
|
||||
];
|
||||
|
||||
cargoArtifacts = craneLib.buildDepsOnly {
|
||||
inherit src;
|
||||
strictDeps = true;
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
sqlite
|
||||
];
|
||||
};
|
||||
|
||||
cargoExtraArgs = lib.escapeShellArgs [ "--features" "static" ];
|
||||
|
||||
partitions = 1;
|
||||
partitionType = "count";
|
||||
cargoNextestPartitionsExtraArgs = "--no-tests=pass";
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user