use a nix package as test
Some checks failed
ci/woodpecker/pr/build_backend Pipeline failed
ci/woodpecker/pr/cargo_check Pipeline failed
ci/woodpecker/pr/cargo_clippy Pipeline failed
ci/woodpecker/pr/cargo_test Pipeline failed
ci/woodpecker/pr/check_fmt Pipeline failed

This commit is contained in:
jopejoe1 2025-04-07 13:43:06 +02:00
parent 023b59a969
commit 6154f3f5fa
5 changed files with 36 additions and 3 deletions

View 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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 (