github.com/argoproj-labs/argocd-operator@v0.10.0/.github/workflows/codegen.yaml (about) 1 name: Generated code 2 on: 3 push: 4 branches: 5 - 'master' 6 pull_request: 7 branches: 8 - 'master' 9 env: 10 # Golang version to use 11 GOLANG_VERSION: '1.21' 12 # Version of operator-sdk binary 13 SDK_VERSION: 1.11.0 14 # Checksum of operator-sdk binary 15 SDK_CHECKSUM: 'b1f6fb02c619cfcdb46edf41cbeb4d66f627fd8bba122edaeeb06718965299eb' 16 17 jobs: 18 check-go-modules: 19 name: "Check for go.mod/go.sum synchronicity" 20 runs-on: ubuntu-latest 21 steps: 22 - name: Checkout code 23 uses: actions/checkout@v2 24 - name: Setup Golang 25 uses: actions/setup-go@v1 26 with: 27 go-version: ${{ env.GOLANG_VERSION }} 28 - name: Download all Go modules 29 run: | 30 go mod download 31 - name: Check for tidyness of go.mod and go.sum 32 run: | 33 go mod tidy 34 git diff --exit-code -- . 35 36 check-sdk-codegen: 37 name: "Check for changes from make bundle" 38 runs-on: ubuntu-latest 39 steps: 40 - name: Checkout code 41 uses: actions/checkout@v2 42 - name: Setup Golang 43 uses: actions/setup-go@v1 44 with: 45 go-version: ${{ env.GOLANG_VERSION }} 46 - name: Download and install Operator SDK 47 run: | 48 set -ue 49 set -o pipefail 50 curl -sLf --retry 3 \ 51 -o /tmp/operator-sdk_linux_amd64 \ 52 https://github.com/operator-framework/operator-sdk/releases/download/v1.11.0/operator-sdk_linux_amd64 53 calculated=$(sha256sum /tmp/operator-sdk_linux_amd64 | awk '{print $1}') 54 if test "${calculated}" != "${SDK_CHECKSUM}"; then 55 echo "FAILED TO VALIDATE CHECKSUM" >&2 56 echo "Download is: ${calculated}" 57 echo "Should: ${SDK_CHECKSUM}" 58 exit 1 59 fi 60 sudo install -m 0755 /tmp/operator-sdk_linux_amd64 /usr/local/bin/operator-sdk 61 - name: Run make bundle 62 run: | 63 make bundle 64 - name: Ensure there is no diff in bundle 65 run: | 66 git diff --exit-code -- . 67 - name: Run make generate 68 run: | 69 make generate 70 - name: Ensure there is no diff in generated assets 71 run: | 72 git diff --exit-code -- . 73 - name: Run make manifests 74 run: | 75 make manifests 76 - name: Ensure there is no diff in manifests 77 run: | 78 git diff --exit-code -- .