3 Commits
Author SHA1 Message Date
BlackAngelTV 096553e429 ci(tests): install dependencies via the host package manager
tests / build-test (push) Has been cancelled
Host-mode runners execute jobs directly on the runner machine, so apt
fails on non-Debian hosts. Detect pacman/apt/dnf so the test workflow
runs on any Linux host, and pull in git as a safety net for checkout.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-08-29 20:50:49 +02:00
BlackAngelTV 7b7962c53f ci: target the self-hosted runner label linux
tests / build-test (push) Has been cancelled
The Gitea runner is registered with the label `linux`, so `ubuntu-latest`
never matched and the workflows could not start. This applies to both the
test and release workflows.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-08-29 20:47:09 +02:00
BlackAngelTV 1903bad336 ci: split tests and release workflows, drop secret requirement
release / release (push) Has been cancelled
tests / build-test (push) Has been cancelled
Release no longer runs or depends on the test suite, and uses the
built-in automatic GITEA_TOKEN with a contents: write permission so no
secret needs to be configured. Tests moved to a dedicated workflow that
runs on every push and pull request.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-08-29 20:43:07 +02:00
2 changed files with 72 additions and 45 deletions

No files matched your search

+18 -45
View File
@@ -1,14 +1,15 @@
# Gitea Actions — Release # Gitea Actions — Release
# #
# Triggered whenever the `version` file at the repository root is bumped. # Triggered whenever the `version` file at the repository root is bumped.
# It builds the application, runs the full test suite (ctest), and creates a # Creates a Gitea release tagged with the new version — but ONLY if the
# Gitea release tagged with the new version — but ONLY if: # version in `version` differs from the latest released tag.
# - the version in `version` differs from the latest released tag, and
# - every test passes.
# #
# Because the release job `needs: build-test`, it never runs when a test fails: # No secret is required: `secrets.GITEA_TOKEN` is the built-in automatic
# Gitea skips dependent jobs after a failure, so a broken suite blocks the # token provided by Gitea on every run. The `permissions: contents: write`
# release automatically. # block below asks for write access to contents and releases, so the release
# can be created without configuring any secret in the repository settings.
# Tests are deliberately not run here; they live in the separate `tests`
# workflow and do not gate releases.
name: release name: release
@@ -20,42 +21,14 @@ on:
- version - version
workflow_dispatch: workflow_dispatch:
permissions:
contents: write
jobs: jobs:
# Build the project and run every test. Fails the run if any test fails, # Reads the new version and publishes a release + git tag when the version
# which in turn stops the `release` job below. # genuinely changed. Runs without any test step.
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
cmake g++ make qt6-base-dev
- name: Configure
run: |
cmake -B build \
-DFWS_BUILD_EXAMPLE_PLUGIN=ON \
-DCMAKE_BUILD_TYPE=Release
- name: Build
run: |
cmake --build build -j$(nproc)
- name: Run all tests
run: |
cd build
ctest --output-on-failure
# Reads the new version and publishes a release + git tag. Only reached when
# build-test succeeded (Gitea `needs` skips the job otherwise) and when the
# version genuinely changed.
release: release:
runs-on: ubuntu-latest runs-on: linux
needs: build-test # guarantees all tests passed before releasing
steps: steps:
- name: Checkout with full history and tags - name: Checkout with full history and tags
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -84,16 +57,16 @@ jobs:
- name: Create release - name: Create release
if: steps.check.outputs.new == 'true' if: steps.check.outputs.new == 'true'
env: env:
# The token used to create the release. For the automatic one to have # Built-in automatic token, no secret to configure. The
# write access it must be granted the 'repository contents' (write) # `permissions` block at the top grants it write access to
# permission on the repo. Otherwise set a GITEA_TOKEN secret. # contents/releases for this run.
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: | run: |
VERSION="${{ steps.version.outputs.value }}" VERSION="${{ steps.version.outputs.value }}"
TAG="v${VERSION}" TAG="v${VERSION}"
BODY=$(cat <<'EOF' BODY=$(cat <<'EOF'
Release automatically generated by the `release` workflow when the Release automatically generated by the `release` workflow when the
`version` file was bumped and all tests passed. `version` file was bumped.
EOF EOF
) )
curl -sS -X POST "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases" \ curl -sS -X POST "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases" \
+54
View File
@@ -0,0 +1,54 @@
# Gitea Actions — Tests
#
# Dedicated test workflow: builds the application and runs the full test suite
# (ctest) on every push and pull request. Kept separate from the release
# workflow so a failing test never blocks a release.
name: tests
on:
push:
pull_request:
workflow_dispatch:
jobs:
build-test:
runs-on: linux
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
# Host-mode runners execute jobs directly on the runner machine, so
# detect its package manager instead of hardcoding apt (which only
# exists on Debian/Ubuntu hosts).
if command -v pacman >/dev/null 2>&1; then
sudo pacman -S --noconfirm --needed \
git cmake gcc make qt6-base
elif command -v apt-get >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y \
git cmake g++ make qt6-base-dev
elif command -v dnf >/dev/null 2>&1; then
sudo dnf install -y \
git cmake gcc-c++ make qt6-qtbase-devel
else
echo "Unsupported package manager: install git, cmake, a C++ compiler, make and Qt6 manually" >&2
exit 1
fi
- name: Configure
run: |
cmake -B build \
-DFWS_BUILD_EXAMPLE_PLUGIN=ON \
-DCMAKE_BUILD_TYPE=Release
- name: Build
run: |
cmake --build build -j$(nproc)
- name: Run all tests
run: |
cd build
ctest --output-on-failure