ci(github): use setup-task with output grouping for tests

Restore the --output group options for better GitHub Actions log
grouping, while keeping the separate build job for compilation check.
This commit is contained in:
Valentin Maerten
2025-12-10 21:51:37 +01:00
parent 17576081b3
commit 442aab1f3e

View File

@@ -13,6 +13,25 @@ concurrency:
cancel-in-progress: true
jobs:
build:
name: 🔨 Build (${{ matrix.go-version }})
strategy:
fail-fast: false
matrix:
go-version: [1.24.x, 1.25.x]
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout
uses: actions/checkout@v6
- name: ⬇️ Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
- name: 🔨 Build
run: go build -v ./cmd/task
test:
name: 🧪 Test (${{ matrix.go-version }}, ${{ matrix.platform }})
strategy:
@@ -30,11 +49,11 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: 🔨 Build
run: go build -v -o ./bin/task ./cmd/task
- name: ⬇️ Setup Task
uses: go-task/setup-task@v1
- name: 🧪 Test
run: ./bin/task test
run: task test --output group --output-group-begin '::group::{{.TASK}}' --output-group-end '::endgroup::'
lint:
name: 🔍 Lint (${{ matrix.go-version }})
@@ -78,12 +97,13 @@ jobs:
ci-status:
name: ✅ CI
runs-on: ubuntu-latest
needs: [test, lint, lint-jsonschema]
needs: [build, test, lint, lint-jsonschema]
if: always()
steps:
- name: ✅ Check CI status
run: |
if [[ "${{ needs.test.result }}" != "success" ]] || \
if [[ "${{ needs.build.result }}" != "success" ]] || \
[[ "${{ needs.test.result }}" != "success" ]] || \
[[ "${{ needs.lint.result }}" != "success" ]] || \
[[ "${{ needs.lint-jsonschema.result }}" != "success" ]]; then
echo "CI failed"