fix(workflows): log GITHUB_TOKEN usage in Homebrew update script for … #18
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 ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| go: [stable] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: Cache Go modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Verify dependencies | |
| run: go mod verify | |
| - name: Configure git for consistent line endings | |
| run: | | |
| git config core.autocrlf false | |
| git config core.eol lf | |
| shell: bash | |
| - name: Check formatting | |
| run: | | |
| # Run gofmt to format files first | |
| gofmt -s -w . | |
| # Check if there were any changes | |
| if ! git diff --quiet; then | |
| echo "❌ Code formatting issues found and fixed:" | |
| git diff --name-only | |
| echo "" | |
| echo "Files have been automatically formatted by gofmt" | |
| echo "Please commit these formatting changes" | |
| exit 1 | |
| fi | |
| echo "✅ All files are properly formatted" | |
| shell: bash | |
| - name: Run go vet | |
| run: go vet ./... | |
| - name: Run tests | |
| run: | | |
| if [ "${{ runner.os }}" = "Windows" ]; then | |
| # On Windows, avoid coverage output issues | |
| go test -v -race ./... | |
| else | |
| # On Unix systems, use coverage | |
| go test -v -race -coverprofile=coverage.out ./... | |
| fi | |
| shell: bash | |
| - name: Build | |
| run: go build -v ./... | |
| security-audit: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: stable | |
| - name: Run govulncheck | |
| run: | | |
| go install golang.org/x/vuln/cmd/govulncheck@latest | |
| govulncheck ./... | |
| minimum-version: | |
| name: Minimum Supported Go Version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go 1.21 | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.21' | |
| - name: Check with minimum version | |
| run: go build -v ./... |