From 67581b24f06c678fc7ea1846e78c26d83564e4e6 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Thu, 18 Jul 2024 22:50:23 +0200 Subject: [PATCH] ci: replace woodpecker with a forgejo actions workflow Signed-off-by: Christoph Heiss --- .forgejo/workflows/main.yaml | 38 +++++++++++++++++++++++++++++++ .woodpecker.yml | 43 ------------------------------------ 2 files changed, 38 insertions(+), 43 deletions(-) create mode 100644 .forgejo/workflows/main.yaml delete mode 100644 .woodpecker.yml diff --git a/.forgejo/workflows/main.yaml b/.forgejo/workflows/main.yaml new file mode 100644 index 0000000..06ef08f --- /dev/null +++ b/.forgejo/workflows/main.yaml @@ -0,0 +1,38 @@ +--- +name: flake + +on: + push: + +env: + NIX_CONFIG: 'experimental-features = nix-command flakes' + +jobs: + build: + runs-on: nixos-unstable + steps: + - name: prepare nix container + run: | + nix-env -iA nixpkgs.nodejs nixpkgs.gnused nixpkgs.curl nixpkgs.gnupg + + - name: checkout repository + uses: actions/checkout@v4 + + - name: prepare flake and secrets + run: | + set -x + for f in $(find secrets/ -type f -name '*.nix'); do + echo '{ }' > "$f"; + done + # do not try to evaluate partly stubbed-out machine configs + regex='nixosConfigurations = \(.*\);$' + replacement='nixosConfigurations =\n builtins.trace (\1) { };' + sed -i "s/$regex/$replacement/" flake.nix + + - name: check git history + run: | + curl -L -o - 'https://c8h4.io/gpg.asc' | gpg --import + nix run .#check-git-history + + - name: run flake check + run: nix flake check -L diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index dbd6692..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -when: - - event: push - -clone: - - name: clone - image: woodpeckerci/plugin-git - settings: - depth: 0 - partial: false - -steps: - - name: prepare - image: docker.io/nixos/nix - environment: - NIX_CONFIG: 'experimental-features = nix-command flakes' - commands: - - nix-env -iA nixpkgs.gnused - - for f in $(find secrets/ -type f -name '*.nix'); do echo '{ }' > "$f"; done - - >- - sed -i - 's/nixosConfigurations = builtins.mapAttrs mkSystem machines;/nixosConfigurations =\n builtins.trace (builtins.mapAttrs mkSystem machines) { };/' - flake.nix - - - name: check-git-history - image: docker.io/nixos/nix - environment: - NIX_CONFIG: 'experimental-features = nix-command flakes' - depends_on: - - prepare - commands: - - nix-env -iA nixpkgs.curl nixpkgs.gnupg - - curl -L -o - 'https://c8h4.io/gpg.asc' | gpg --import - - nix run .#check-git-history - - - name: flake-check - image: docker.io/nixos/nix - environment: - NIX_CONFIG: 'experimental-features = nix-command flakes' - depends_on: - - prepare - commands: - - nix flake check -L