From 2cb7eaa3cc4752630bf0de5d2172b80104ade78e Mon Sep 17 00:00:00 2001 From: Valentin Maerten Date: Sun, 7 Dec 2025 16:12:57 +0100 Subject: [PATCH] ci(github): improve workflow structure and add build job --- .github/workflows/ci.yml | 77 +++++++++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c327caf..30e5b3bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,27 @@ 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 }}) + name: ๐Ÿงช Test (${{ matrix.go-version }}, ${{ matrix.platform }}) strategy: fail-fast: false matrix: @@ -22,67 +41,69 @@ jobs: platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - - uses: actions/setup-go@v6 + - name: ๐Ÿ“ฅ Checkout + uses: actions/checkout@v6 + + - name: โฌ‡๏ธ Setup Go + uses: actions/setup-go@v6 with: go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v6 + - name: โฌ‡๏ธ Setup Task + uses: go-task/setup-task@v1 - - 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::' + - name: ๐Ÿงช Test + run: task test lint: - name: Lint (${{ matrix.go-version }}) + 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 + - name: ๐Ÿ“ฅ Checkout + uses: actions/checkout@v6 + + - name: โฌ‡๏ธ Setup Go + uses: actions/setup-go@v6 with: go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v6 - - - name: golangci-lint + - name: ๐Ÿ” Lint uses: golangci/golangci-lint-action@v9 with: version: v2.7.1 lint-jsonschema: - name: Lint JSON Schema + name: ๐Ÿ“‹ Lint JSON Schema runs-on: ubuntu-latest steps: - - uses: actions/setup-python@v6 + - name: ๐Ÿ“ฅ Checkout + uses: actions/checkout@v6 + + - name: โฌ‡๏ธ Setup Python + uses: actions/setup-python@v6 with: python-version: 3.14 - - uses: actions/checkout@v6 - - - name: install check-jsonschema + - name: โฌ‡๏ธ Install check-jsonschema run: python -m pip install 'check-jsonschema==0.27.3' - - name: check-jsonschema (metaschema) + - name: ๐Ÿ“‹ Validate JSON Schema run: check-jsonschema --check-metaschema website/src/public/schema.json ci-status: - name: CI + name: โœ… CI runs-on: ubuntu-latest - needs: [test, lint, lint-jsonschema] + needs: [build, test, lint, lint-jsonschema] if: always() steps: - - name: Check CI status + - 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"