use a nix package as test
This commit is contained in:
parent
023b59a969
commit
6154f3f5fa
5 changed files with 36 additions and 3 deletions
11
.woodpecker/build_backend.yaml
Normal file
11
.woodpecker/build_backend.yaml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
when:
|
||||||
|
- event: pull_request
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "Run cargo test"
|
||||||
|
image: nixos/nix
|
||||||
|
commands:
|
||||||
|
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
|
||||||
|
- nix build --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt .#backend
|
||||||
|
volumes:
|
||||||
|
- /nix:/mnt/nix:ro
|
|
@ -3,7 +3,7 @@ when:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Run cargo clippy"
|
- name: "Run cargo clippy"
|
||||||
image: docker.nix-community.org/nixpkgs/nix-flakes
|
image: nixos/nix
|
||||||
commands:
|
commands:
|
||||||
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
|
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
|
||||||
- nix develop --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt
|
- nix develop --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt
|
||||||
|
|
|
@ -3,7 +3,7 @@ when:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Run cargo test"
|
- name: "Run cargo test"
|
||||||
image: docker.nix-community.org/nixpkgs/nix-flakes
|
image: nixos/nix
|
||||||
commands:
|
commands:
|
||||||
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
|
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
|
||||||
- nix develop --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt
|
- nix develop --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt
|
||||||
|
|
|
@ -3,7 +3,7 @@ when:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Run treefmt"
|
- name: "Run treefmt"
|
||||||
image: docker.nix-community.org/nixpkgs/nix-flakes
|
image: nixos/nix
|
||||||
commands:
|
commands:
|
||||||
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
|
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
|
||||||
- nix fmt --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt -- --fail-on-change
|
- nix fmt --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt -- --fail-on-change
|
||||||
|
|
22
flake.nix
22
flake.nix
|
@ -80,6 +80,28 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
backend = pkgs.rustPlatform.buildRustPackage rec {
|
||||||
|
pname = "backend";
|
||||||
|
version = "0.1";
|
||||||
|
|
||||||
|
src = pkgs.lib.fileset.toSource {
|
||||||
|
root = ./.;
|
||||||
|
fileset = pkgs.lib.fileset.unions [
|
||||||
|
./Cargo.lock
|
||||||
|
./Cargo.toml
|
||||||
|
./crates
|
||||||
|
./.cargo
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
cargoLock = {
|
||||||
|
lockFile = ./Cargo.lock;
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
mainProgram = "backend";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
formatter = forSystems (
|
formatter = forSystems (
|
||||||
|
|
Loading…
Add table
Reference in a new issue