From 8f06b8b386c62e6d24e85ace242428922ef34691 Mon Sep 17 00:00:00 2001 From: "Aleksei (Faumaray) Selikhov" Date: Sat, 5 Dec 2026 14:25:33 +0300 Subject: [PATCH] ci: discover the dev toolchain in the runner PATH --- .gitea/workflows/ci.yml | 12 ++++++++++-- .gitea/workflows/release.yml | 13 +++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d961dab..95f374c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -11,15 +11,23 @@ on: push: branches: [main] pull_request: + workflow_dispatch: jobs: build-and-test-gcc16: runs-on: linux steps: - uses: actions/checkout@v4 - - name: Check the dev toolchain + - name: Set up the dev toolchain run: | - command -v dev || { echo "the 'dev' toolchain wrapper is required on this runner" >&2; exit 1; } + for dir in /etc/profiles/per-user/*/bin /run/current-system/sw/bin /nix/var/nix/profiles/default/bin; do + if [ -d "$dir" ] && [ -x "$dir/dev" ]; then + export PATH="$dir:$PATH" + break + fi + done + command -v dev || { echo "the 'dev' toolchain wrapper was not found on this runner" >&2; exit 1; } + echo "PATH=$PATH" >> "$GITHUB_ENV" dev cpp-gcc -c g++ --version | head -1 - name: Configure (Debug, Ninja, GCC 16 C++26) run: | diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 7dbf621..ff998cf 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -11,6 +11,7 @@ name: Release on: push: tags: ["v*"] + workflow_dispatch: permissions: contents: write @@ -22,9 +23,17 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Check the dev toolchain + - name: Set up the dev toolchain run: | - command -v dev || { echo "the 'dev' toolchain wrapper is required on this runner" >&2; exit 1; } + for dir in /etc/profiles/per-user/*/bin /run/current-system/sw/bin /nix/var/nix/profiles/default/bin; do + if [ -d "$dir" ] && [ -x "$dir/dev" ]; then + export PATH="$dir:$PATH" + break + fi + done + command -v dev || { echo "the 'dev' toolchain wrapper was not found on this runner" >&2; exit 1; } + echo "PATH=$PATH" >> "$GITHUB_ENV" + dev cpp-gcc -c g++ --version | head -1 - name: Verify the tag matches the project version run: | tag="${GITHUB_REF_NAME}"