ci: replace woodpecker with a forgejo actions workflow
All checks were successful
flake / build (push) Successful in 3m44s
All checks were successful
flake / build (push) Successful in 3m44s
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
parent
a169c5e3f6
commit
67581b24f0
38
.forgejo/workflows/main.yaml
Normal file
38
.forgejo/workflows/main.yaml
Normal file
|
@ -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
|
|
@ -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
|
|
Loading…
Reference in a new issue