Skip to content

Commit 8cc70d5

Browse files
committed
ci(github): consolidate test and lint into single workflow
1 parent 8cd51af commit 8cc70d5

File tree

3 files changed

+91
-81
lines changed

3 files changed

+91
-81
lines changed

.github/workflows/ci.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
tags:
7+
- v*
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ci-${{ github.head_ref || github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
test:
17+
name: Test (${{ matrix.go-version }}, ${{ matrix.platform }})
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
go-version: [1.24.x, 1.25.x]
22+
platform: [ubuntu-latest, macos-latest, windows-latest]
23+
runs-on: ${{ matrix.platform }}
24+
steps:
25+
- uses: actions/setup-go@v6
26+
with:
27+
go-version: ${{ matrix.go-version }}
28+
29+
- uses: actions/checkout@v6
30+
31+
- name: Download Go modules
32+
run: go mod download
33+
env:
34+
GOPROXY: https://proxy.golang.org
35+
36+
- name: Build
37+
run: go build -o ./bin/task -v ./cmd/task
38+
39+
- name: Test
40+
run: ./bin/task test --output=group --output-group-begin='::group::{{.TASK}}' --output-group-end='::endgroup::'
41+
42+
lint:
43+
name: Lint (${{ matrix.go-version }})
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
go-version: [1.24.x, 1.25.x]
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/setup-go@v6
51+
with:
52+
go-version: ${{ matrix.go-version }}
53+
54+
- uses: actions/checkout@v6
55+
56+
- name: golangci-lint
57+
uses: golangci/golangci-lint-action@v9
58+
with:
59+
version: v2.7.1
60+
61+
lint-jsonschema:
62+
name: Lint JSON Schema
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/setup-python@v6
66+
with:
67+
python-version: 3.14
68+
69+
- uses: actions/checkout@v6
70+
71+
- name: install check-jsonschema
72+
run: python -m pip install 'check-jsonschema==0.27.3'
73+
74+
- name: check-jsonschema (metaschema)
75+
run: check-jsonschema --check-metaschema website/src/public/schema.json
76+
77+
ci-status:
78+
name: CI
79+
runs-on: ubuntu-latest
80+
needs: [test, lint, lint-jsonschema]
81+
if: always()
82+
steps:
83+
- name: Check CI status
84+
run: |
85+
if [[ "${{ needs.test.result }}" != "success" ]] || \
86+
[[ "${{ needs.lint.result }}" != "success" ]] || \
87+
[[ "${{ needs.lint-jsonschema.result }}" != "success" ]]; then
88+
echo "CI failed"
89+
exit 1
90+
fi
91+
echo "CI passed"

.github/workflows/lint.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)