Test CI #54

Open
irgendwas wants to merge 4 commits from ci/test into main
7 changed files with 57 additions and 11 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,10 @@ when:
steps:
- name: "Run cargo check"
image: docker.nix-community.org/nixpkgs/nix-flakes
image: nixos/nix
commands:
- nix shell github:nixos/nixpkgs/nixos-unstable#cargo github:nixos/nixpkgs/nixos-unstable#gcc
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
- nix develop --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt
- cargo check --workspace --all-targets
volumes:
- /nix:/mnt/nix:ro

View file

@ -3,7 +3,10 @@ when:
steps:
- name: "Run cargo clippy"
image: docker.nix-community.org/nixpkgs/nix-flakes
image: nixos/nix
commands:
- nix shell github:nixos/nixpkgs/nixos-unstable#clippy github:nixos/nixpkgs/nixos-unstable#cargo github:nixos/nixpkgs/nixos-unstable#gcc
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
- nix develop --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt
- cargo clippy
volumes:
- /nix:/mnt/nix:ro

View file

@ -3,7 +3,10 @@ when:
steps:
- name: "Run cargo test"
image: docker.nix-community.org/nixpkgs/nix-flakes
image: nixos/nix
commands:
- nix shell github:nixos/nixpkgs/nixos-unstable#cargo github:nixos/nixpkgs/nixos-unstable#gcc
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
- nix develop --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt
- cargo test --workspace --all-targets
volumes:
- /nix:/mnt/nix:ro

View file

@ -3,6 +3,9 @@ when:
steps:
- name: "Run treefmt"
image: docker.nix-community.org/nixpkgs/nix-flakes
image: nixos/nix
commands:
- nix fmt -- --fail-on-change
- 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
volumes:
- /nix:/mnt/nix:ro

6
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1742889210,
"narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=",
"lastModified": 1743827369,
"narHash": "sha256-rpqepOZ8Eo1zg+KJeWoq1HAOgoMCDloqv5r2EAa9TSA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "698214a32beb4f4c8e3942372c694f40848b360d",
"rev": "42a1c966be226125b48c384171c44c651c236c22",
"type": "github"
},
"original": {

View file

@ -26,6 +26,7 @@
nodejs
cargo
clippy
gcc
];
};
}
@ -79,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 (