From 77abf68e3c8b09434ffcf1b02499497d74c9029b Mon Sep 17 00:00:00 2001 From: Rahix Date: Thu, 22 May 2025 09:49:33 +0200 Subject: [PATCH] ci: Add CI workflows The push.yml workflow builds the manager and then places it in the $HOME of the runner. The issue.ym then uses the cached tool binary to update the techtree information whenever any issue is changed. This approach of course only works as long as only one runner is connected to this repository. In the long run, this approach shall be replaced by a nix build of the techtree-manager which is then cached by the OS instead of manually. --- .forgejo/workflows/issue.yml | 14 ++++++++++++++ .forgejo/workflows/push.yml | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .forgejo/workflows/issue.yml create mode 100644 .forgejo/workflows/push.yml diff --git a/.forgejo/workflows/issue.yml b/.forgejo/workflows/issue.yml new file mode 100644 index 0000000..b58a047 --- /dev/null +++ b/.forgejo/workflows/issue.yml @@ -0,0 +1,14 @@ +on: + issues: + types: [opened, reopened, closed, labeled, unlabeled, edited] + +jobs: + test: + runs-on: self-hosted-nixos-x86_64 + steps: + - uses: https://data.forgejo.org/actions/checkout@v4 + - name: Check techtree-manager presence + run: | + test -e ~/.cache/fafo-techtree/techtree-manager + - name: Run techtree-manager + run: cd techtree-manager/ && nix-shell shell.nix --run ~/.cache/fafo-techtree/techtree-manager diff --git a/.forgejo/workflows/push.yml b/.forgejo/workflows/push.yml new file mode 100644 index 0000000..733d119 --- /dev/null +++ b/.forgejo/workflows/push.yml @@ -0,0 +1,14 @@ +on: + push: + +jobs: + build: + runs-on: self-hosted-nixos-x86_64 + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - name: Build techtree manager tool + run: cd techtree-manager/ && nix-shell shell.nix --run "cargo build --release" + - name: Cache the techtree manager tool + run: | + mkdir -p ~/.cache/fafo-techtree + cp -v techtree-manager/target/release/techtree-manager ~/.cache/fafo-techtree/techtree-manager