From 63b3c648992d1e54302ca124f993577c116bbe5a Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 27 Jul 2023 13:51:39 +0900 Subject: [PATCH] Remove duplicate jobs from github workflow We now run pre-commit job in prow which covers most of go-lang tasks. This also adds a github action that checks for go.mod replace, which was added to several operator repos. --- .github/workflows/golangci-lint.yaml | 53 ---------------------------- .github/workflows/lints.yaml | 14 ++++++++ 2 files changed, 14 insertions(+), 53 deletions(-) delete mode 100644 .github/workflows/golangci-lint.yaml create mode 100644 .github/workflows/lints.yaml diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml deleted file mode 100644 index 78f5bb72..00000000 --- a/.github/workflows/golangci-lint.yaml +++ /dev/null @@ -1,53 +0,0 @@ -name: Golang lint, vet and unit test pipeline - -on: [push, pull_request] - -jobs: - test: - name: github (govet, golint and gotest) - runs-on: ubuntu-latest - steps: - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: 1.19.x - - name: Checkout project code - uses: actions/checkout@v2 - - name: Checkout openstack-k8s-operators-ci project - uses: actions/checkout@v2 - with: - repository: openstack-k8s-operators/openstack-k8s-operators-ci - path: ./openstack-k8s-operators-ci - - name: Run govet.sh - run: ./openstack-k8s-operators-ci/test-runner/govet.sh - - name: Run golint.sh - run: ./openstack-k8s-operators-ci/test-runner/golint.sh - - golangci: - name: github (golangci) - runs-on: ubuntu-latest - steps: - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: 1.19.x - - name: Checkout project code - uses: actions/checkout@v2 - - name: Run golangci lint - uses: golangci/golangci-lint-action@v2 - with: - version: latest - args: --timeout 5m - - operator-lint: - name: operator-lint - runs-on: ubuntu-latest - steps: - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: 1.19.x - - name: Checkout project code - uses: actions/checkout@v2 - - name: Run operator-lint - run: make operator-lint diff --git a/.github/workflows/lints.yaml b/.github/workflows/lints.yaml new file mode 100644 index 00000000..11281ae8 --- /dev/null +++ b/.github/workflows/lints.yaml @@ -0,0 +1,14 @@ +name: Lints + +on: [pull_request] + +jobs: + check-go-mod-replace-lines: + name: check for replace lines in go.mod files + runs-on: ubuntu-latest + steps: + - name: Checkout project code + uses: actions/checkout@v3 + - name: check for replace lines in go.mod files + run: | + ! egrep --invert-match -e '^replace.*/api => \./api|^replace.*//allow-merging$' `find . -name 'go.mod'` | egrep -e 'go.mod:replace'