Skip to content

Commit 2cb7eaa

Browse files
committed
ci(github): improve workflow structure and add build job
1 parent 8cc70d5 commit 2cb7eaa

File tree

1 file changed

+49
-28
lines changed

1 file changed

+49
-28
lines changed

.github/workflows/ci.yml

Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,76 +13,97 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
jobs:
16+
build:
17+
name: 🔨 Build (${{ matrix.go-version }})
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
go-version: [1.24.x, 1.25.x]
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: 📥 Checkout
25+
uses: actions/checkout@v6
26+
27+
- name: ⬇️ Setup Go
28+
uses: actions/setup-go@v6
29+
with:
30+
go-version: ${{ matrix.go-version }}
31+
32+
- name: 🔨 Build
33+
run: go build -v ./cmd/task
34+
1635
test:
17-
name: Test (${{ matrix.go-version }}, ${{ matrix.platform }})
36+
name: 🧪 Test (${{ matrix.go-version }}, ${{ matrix.platform }})
1837
strategy:
1938
fail-fast: false
2039
matrix:
2140
go-version: [1.24.x, 1.25.x]
2241
platform: [ubuntu-latest, macos-latest, windows-latest]
2342
runs-on: ${{ matrix.platform }}
2443
steps:
25-
- uses: actions/setup-go@v6
44+
- name: 📥 Checkout
45+
uses: actions/checkout@v6
46+
47+
- name: ⬇️ Setup Go
48+
uses: actions/setup-go@v6
2649
with:
2750
go-version: ${{ matrix.go-version }}
2851

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
52+
- name: ⬇️ Setup Task
53+
uses: go-task/setup-task@v1
3854

39-
- name: Test
40-
run: ./bin/task test --output=group --output-group-begin='::group::{{.TASK}}' --output-group-end='::endgroup::'
55+
- name: 🧪 Test
56+
run: task test
4157

4258
lint:
43-
name: Lint (${{ matrix.go-version }})
59+
name: 🔍 Lint (${{ matrix.go-version }})
4460
strategy:
4561
fail-fast: false
4662
matrix:
4763
go-version: [1.24.x, 1.25.x]
4864
runs-on: ubuntu-latest
4965
steps:
50-
- uses: actions/setup-go@v6
66+
- name: 📥 Checkout
67+
uses: actions/checkout@v6
68+
69+
- name: ⬇️ Setup Go
70+
uses: actions/setup-go@v6
5171
with:
5272
go-version: ${{ matrix.go-version }}
5373

54-
- uses: actions/checkout@v6
55-
56-
- name: golangci-lint
74+
- name: 🔍 Lint
5775
uses: golangci/golangci-lint-action@v9
5876
with:
5977
version: v2.7.1
6078

6179
lint-jsonschema:
62-
name: Lint JSON Schema
80+
name: 📋 Lint JSON Schema
6381
runs-on: ubuntu-latest
6482
steps:
65-
- uses: actions/setup-python@v6
83+
- name: 📥 Checkout
84+
uses: actions/checkout@v6
85+
86+
- name: ⬇️ Setup Python
87+
uses: actions/setup-python@v6
6688
with:
6789
python-version: 3.14
6890

69-
- uses: actions/checkout@v6
70-
71-
- name: install check-jsonschema
91+
- name: ⬇️ Install check-jsonschema
7292
run: python -m pip install 'check-jsonschema==0.27.3'
7393

74-
- name: check-jsonschema (metaschema)
94+
- name: 📋 Validate JSON Schema
7595
run: check-jsonschema --check-metaschema website/src/public/schema.json
7696

7797
ci-status:
78-
name: CI
98+
name: CI
7999
runs-on: ubuntu-latest
80-
needs: [test, lint, lint-jsonschema]
100+
needs: [build, test, lint, lint-jsonschema]
81101
if: always()
82102
steps:
83-
- name: Check CI status
103+
- name: Check CI status
84104
run: |
85-
if [[ "${{ needs.test.result }}" != "success" ]] || \
105+
if [[ "${{ needs.build.result }}" != "success" ]] || \
106+
[[ "${{ needs.test.result }}" != "success" ]] || \
86107
[[ "${{ needs.lint.result }}" != "success" ]] || \
87108
[[ "${{ needs.lint-jsonschema.result }}" != "success" ]]; then
88109
echo "CI failed"

0 commit comments

Comments
 (0)