Merge pull request #49 from ZanzyTHEbar/copilot/setup-copilot-instruc… #87
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, dev] | |
| pull_request: | |
| branches: [main, dev] | |
| permissions: | |
| contents: read | |
| env: | |
| GO_VERSION: "1.24.x" | |
| jobs: | |
| lint-test: | |
| name: Lint & Test (Go) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: true | |
| - name: Go module download | |
| run: | | |
| set -euo pipefail | |
| go mod download | |
| - name: Lint (gofmt) | |
| run: | | |
| set -euo pipefail | |
| fmt_out=$(gofmt -l . | tee /dev/stderr) | |
| if [ -n "$fmt_out" ]; then | |
| echo "Found unformatted files. Run 'gofmt -w .' locally."; | |
| exit 1; | |
| fi | |
| - name: Vet | |
| run: | | |
| set -euo pipefail | |
| go vet ./... | |
| - name: Test (race + cover) | |
| run: | | |
| set -euo pipefail | |
| go test -race -covermode=atomic -coverprofile=coverage.out ./... | |
| - name: Upload coverage artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: coverage.out | |
| build-binaries: | |
| name: Build Binaries (Go) | |
| runs-on: ubuntu-latest | |
| needs: lint-test | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: true | |
| - name: Install build dependencies | |
| run: | | |
| set -euo pipefail | |
| sudo apt-get update && sudo apt-get install -y build-essential gcc g++ | |
| - name: Build cmd targets | |
| run: | | |
| set -euo pipefail | |
| make deps | |
| make build |