ci: run architecture and security validation in flake check and gitea actions
This commit is contained in:
1 parent
f4b676be33
commit
33514663a3
2 files changed
+55
-2
No files matched your search
@@ -0,0 +1,21 @@
|
||||
name: Core Architecture & Invariant CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
uses: DeterminateSystems/nix-installer-action@main
|
||||
|
||||
- name: Run Architecture & Security Invariant Checks
|
||||
run: |
|
||||
nix flake check
|
||||
@@ -10,14 +10,46 @@
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, sops-nix, ... }@inputs: {
|
||||
outputs = { self, nixpkgs, sops-nix, ... }@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
nixosConfigurations.server = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
inherit system;
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
./nixos/configuration.nix
|
||||
sops-nix.nixosModules.sops
|
||||
];
|
||||
};
|
||||
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
python3
|
||||
python3Packages.pytest
|
||||
python3Packages.pyyaml
|
||||
ruff
|
||||
];
|
||||
};
|
||||
|
||||
checks.${system} = {
|
||||
test-suite = pkgs.runCommand "core-tests" {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
python3
|
||||
python3Packages.pytest
|
||||
python3Packages.pyyaml
|
||||
ruff
|
||||
];
|
||||
} ''
|
||||
mkdir -p $out
|
||||
cp -r ${self} source
|
||||
chmod -R u+w source
|
||||
cd source
|
||||
HOME=/tmp ruff check --no-cache .
|
||||
HOME=/tmp pytest -o cache_dir=/tmp/.pytest_cache tests/
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user