mirror of
https://github.com/go-task/task.git
synced 2025-12-16 11:47:44 +01:00
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:
30
.github/workflows/ci.yml
vendored
30
.github/workflows/ci.yml
vendored
@@ -13,6 +13,25 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
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:
|
test:
|
||||||
name: 🧪 Test (${{ matrix.go-version }}, ${{ matrix.platform }})
|
name: 🧪 Test (${{ matrix.go-version }}, ${{ matrix.platform }})
|
||||||
strategy:
|
strategy:
|
||||||
@@ -30,11 +49,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
|
|
||||||
- name: 🔨 Build
|
- name: ⬇️ Setup Task
|
||||||
run: go build -v -o ./bin/task ./cmd/task
|
uses: go-task/setup-task@v1
|
||||||
|
|
||||||
- name: 🧪 Test
|
- name: 🧪 Test
|
||||||
run: ./bin/task test
|
run: task test --output group --output-group-begin '::group::{{.TASK}}' --output-group-end '::endgroup::'
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
name: 🔍 Lint (${{ matrix.go-version }})
|
name: 🔍 Lint (${{ matrix.go-version }})
|
||||||
@@ -78,12 +97,13 @@ jobs:
|
|||||||
ci-status:
|
ci-status:
|
||||||
name: ✅ CI
|
name: ✅ CI
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [test, lint, lint-jsonschema]
|
needs: [build, test, lint, lint-jsonschema]
|
||||||
if: always()
|
if: always()
|
||||||
steps:
|
steps:
|
||||||
- name: ✅ Check CI status
|
- name: ✅ Check CI status
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ needs.test.result }}" != "success" ]] || \
|
if [[ "${{ needs.build.result }}" != "success" ]] || \
|
||||||
|
[[ "${{ needs.test.result }}" != "success" ]] || \
|
||||||
[[ "${{ needs.lint.result }}" != "success" ]] || \
|
[[ "${{ needs.lint.result }}" != "success" ]] || \
|
||||||
[[ "${{ needs.lint-jsonschema.result }}" != "success" ]]; then
|
[[ "${{ needs.lint-jsonschema.result }}" != "success" ]]; then
|
||||||
echo "CI failed"
|
echo "CI failed"
|
||||||
|
|||||||
Reference in New Issue
Block a user