github.com/openshift-online/ocm-sdk-go@v0.1.473/.github/workflows/check-pull-request.yaml (about) 1 # 2 # Copyright (c) 2021 Red Hat, Inc. 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 # 16 17 name: Check pull request 18 19 on: 20 pull_request: 21 branches: 22 - main 23 24 jobs: 25 26 test: 27 name: Test 28 strategy: 29 matrix: 30 go: 31 - "1.21" 32 platform: 33 - ubuntu-latest 34 - macos-latest 35 - windows-latest 36 runs-on: ${{ matrix.platform }} 37 steps: 38 - name: Checkout the source 39 uses: actions/checkout@v2 40 41 - name: Install Keyrings (macOS-only) 42 if: ${{ contains(fromJSON('["macos-latest"]'), matrix.platform) }} 43 run: brew install pass gnupg 44 45 - name: Install Keyrings (linux) 46 if: ${{ contains(fromJSON('["ubuntu-latest"]'), matrix.platform) }} 47 run: sudo apt-get install pass 48 49 - name: Setup Go 50 uses: actions/setup-go@v2 51 with: 52 go-version: ${{ matrix.go }} 53 54 - name: Run the tests 55 run: make tests ginkgo_flags="--skip-package leadership,retry" 56 57 - name: Build the examples 58 run: make examples 59 60 lint: 61 name: Lint 62 runs-on: ubuntu-latest 63 steps: 64 - uses: actions/checkout@v4 65 - uses: actions/setup-go@v5 66 with: 67 go-version: stable 68 - name: golangci-lint 69 uses: golangci/golangci-lint-action@v8 70 with: 71 version: v2.1 72 args: --timeout 10m 73 skip-cache: 'true' 74 75 generate: 76 name: Generate 77 runs-on: ubuntu-latest 78 steps: 79 - name: Checkout the source 80 uses: actions/checkout@v2 81 82 - name: Setup Go 83 uses: actions/setup-go@v2 84 with: 85 go-version: '1.21' 86 87 - name: Generate code 88 run: make generate 89 90 - name: Check differences 91 run: | 92 git diff --exit-code \ 93 accesstransparency \ 94 accountsmgmt \ 95 addonsmgmt \ 96 authorizations \ 97 clustersmgmt \ 98 jobqueue \ 99 servicelogs \ 100 servicemgmt \ 101 osdfleetmgmt \ 102 webrca