diff --git a/.github/workflows/go-build.yml b/.github/workflows/go-build.yml index f84a25a..9a88a24 100644 --- a/.github/workflows/go-build.yml +++ b/.github/workflows/go-build.yml @@ -3,16 +3,27 @@ run-name: ${{ github.actor }} runs build on: [push] jobs: build-k8s-athenz-syncer: - runs-on: ubuntu-latest + runs-on: golang:1.22 steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Setup Go 1.22.x + uses: actions/setup-go@v5 + with: + # Semantic version range syntax or exact version of Go + go-version: '1.22.x' - name: Check out repository code uses: actions/checkout@v4 - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - name: List files in the repository run: | ls ${{ github.workspace }} + - name: Run tests + run: go test -v -race ./... + - name: Print diff + run: diff -u <(echo -n) <(gofmt -d .) + - name: Go vet + run: go vet ./... + - name: Go build + run: go build -v -race ./... - run: echo "🍏 This job's status is ${{ job.status }}."