name: CI on: [push, pull_request] jobs: go_lint: name: Go lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v4 with: go-version-file: 'go.mod' check-latest: true - name: Install Task uses: arduino/setup-task@v2 with: version: 3.x - name: lint run: task lint go_build: name: Go build runs-on: ubuntu-latest needs: ["go_lint"] steps: - name: Check out code into the Go module directory uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v4 with: go-version-file: 'go.mod' check-latest: true id: go - name: Get dependencies run: | go get -v -t -d ./... - name: Build run: | go build -v . go_test: name: Go test runs-on: ubuntu-latest needs: ["go_build"] steps: - name: Install Aspell run: sudo apt-get update && sudo apt-get install -y aspell aspell-en - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v4 with: go-version-file: 'go.mod' check-latest: true id: go - name: Get dependencies run: | go get -v -t -d ./... - name: Build run: | go test ./... check_commit: if: ${{ github.event_name == 'pull_request' }} name: HAProxy check commit policy runs-on: ubuntu-latest needs: ["go_build"] steps: - name: Install Aspell run: sudo apt-get update && sudo apt-get install -y aspell aspell-en - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v4 with: go-version-file: 'go.mod' check-latest: true - name: check-commit run: go build -o check && ./check env: API_TOKEN: ${{ secrets.GITHUB_TOKEN }}