From 534ba2bf27783fdf6927e88210b4b999b47455e7 Mon Sep 17 00:00:00 2001 From: Jonathan West Date: Mon, 22 Jan 2024 02:42:24 -0500 Subject: [PATCH] Add gofmt check and fix branch names Signed-off-by: Jonathan West --- .github/workflows/e2e_tests.yml | 2 +- .github/workflows/go.yml | 17 ++++++++++++++++- .github/workflows/lint.yaml | 8 +++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 88f5b92..545ba65 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -2,7 +2,7 @@ name: Run E2E tests on: push: branches: - - 'master' + - 'main' - 'release-*' pull_request: branches: diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7236fbd..50cec0b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,7 +6,7 @@ name: Go on: push: branches: - - 'master' + - 'main' - 'release-*' pull_request: branches: @@ -29,3 +29,18 @@ jobs: - name: Test run: make test + + gofmt: + name: "Ensure that code is gofmt-ed" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Setup Golang + uses: actions/setup-go@v5.0.0 + with: + go-version-file: './go.mod' + - name: "Run make fmt and then 'git diff' to see if anything changed: to fix this check, run make fmt and then commit the changes." + run: | + make fmt + git diff --exit-code -- . + \ No newline at end of file diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index b296dc9..4d4be77 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,12 +1,18 @@ name: Lint code on: + + push: + branches: + - 'main' + - 'release-*' + pull_request: branches: - '*' jobs: lint_code: - name: Run golangci-lint and gosec on PR + name: Run golangci-lint and gosec runs-on: ubuntu-latest steps: - name: Checkout code