mirror of
https://github.com/go-task/task.git
synced 2025-12-16 11:47:44 +01:00
ci(github): consolidate test and lint into single workflow
This commit is contained in:
91
.github/workflows/ci.yml
vendored
Normal file
91
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ci-${{ github.head_ref || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Test (${{ matrix.go-version }}, ${{ matrix.platform }})
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
go-version: [1.24.x, 1.25.x]
|
||||||
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/setup-go@v6
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go-version }}
|
||||||
|
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Download Go modules
|
||||||
|
run: go mod download
|
||||||
|
env:
|
||||||
|
GOPROXY: https://proxy.golang.org
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: go build -o ./bin/task -v ./cmd/task
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: ./bin/task test --output=group --output-group-begin='::group::{{.TASK}}' --output-group-end='::endgroup::'
|
||||||
|
|
||||||
|
lint:
|
||||||
|
name: Lint (${{ matrix.go-version }})
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
go-version: [1.24.x, 1.25.x]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/setup-go@v6
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go-version }}
|
||||||
|
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: golangci-lint
|
||||||
|
uses: golangci/golangci-lint-action@v9
|
||||||
|
with:
|
||||||
|
version: v2.7.1
|
||||||
|
|
||||||
|
lint-jsonschema:
|
||||||
|
name: Lint JSON Schema
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/setup-python@v6
|
||||||
|
with:
|
||||||
|
python-version: 3.14
|
||||||
|
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: install check-jsonschema
|
||||||
|
run: python -m pip install 'check-jsonschema==0.27.3'
|
||||||
|
|
||||||
|
- name: check-jsonschema (metaschema)
|
||||||
|
run: check-jsonschema --check-metaschema website/src/public/schema.json
|
||||||
|
|
||||||
|
ci-status:
|
||||||
|
name: CI
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [test, lint, lint-jsonschema]
|
||||||
|
if: always()
|
||||||
|
steps:
|
||||||
|
- name: Check CI status
|
||||||
|
run: |
|
||||||
|
if [[ "${{ needs.test.result }}" != "success" ]] || \
|
||||||
|
[[ "${{ needs.lint.result }}" != "success" ]] || \
|
||||||
|
[[ "${{ needs.lint-jsonschema.result }}" != "success" ]]; then
|
||||||
|
echo "CI failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "CI passed"
|
||||||
43
.github/workflows/lint.yml
vendored
43
.github/workflows/lint.yml
vendored
@@ -1,43 +0,0 @@
|
|||||||
name: Lint
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- v*
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
name: Lint
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
go-version: [1.24.x, 1.25.x]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/setup-go@v6
|
|
||||||
with:
|
|
||||||
go-version: ${{matrix.go-version}}
|
|
||||||
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: golangci-lint
|
|
||||||
uses: golangci/golangci-lint-action@v9
|
|
||||||
with:
|
|
||||||
version: v2.7.2
|
|
||||||
|
|
||||||
lint-jsonschema:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.14
|
|
||||||
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: install check-jsonschema
|
|
||||||
run: python -m pip install 'check-jsonschema==0.27.3'
|
|
||||||
|
|
||||||
- name: check-jsonschema (metaschema)
|
|
||||||
run: check-jsonschema --check-metaschema website/src/public/schema.json
|
|
||||||
38
.github/workflows/test.yml
vendored
38
.github/workflows/test.yml
vendored
@@ -1,38 +0,0 @@
|
|||||||
name: Test
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- v*
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
name: Test
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
go-version: [1.24.x, 1.25.x]
|
|
||||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
|
||||||
runs-on: ${{matrix.platform}}
|
|
||||||
steps:
|
|
||||||
- name: Set up Go ${{matrix.go-version}}
|
|
||||||
uses: actions/setup-go@v6
|
|
||||||
with:
|
|
||||||
go-version: ${{matrix.go-version}}
|
|
||||||
id: go
|
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Download Go modules
|
|
||||||
run: go mod download
|
|
||||||
env:
|
|
||||||
GOPROXY: https://proxy.golang.org
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: go build -o ./bin/task -v ./cmd/task
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: ./bin/task test --output=group --output-group-begin='::group::{{.TASK}}' --output-group-end='::endgroup::'
|
|
||||||
Reference in New Issue
Block a user