Add mikeshng as approver #197
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Go | |
| on: | |
| workflow_dispatch: {} | |
| pull_request: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'CHANGELOG/**' | |
| - 'LICENSE' | |
| env: | |
| # Common versions | |
| GO_VERSION: '1.26' | |
| GO_REQUIRED_MIN_VERSION: '' | |
| KUBERNETES_VERSION: 'v1.32.2' | |
| GOPATH: '/home/runner/work/cluster-permission/cluster-permission/go' | |
| defaults: | |
| run: | |
| working-directory: go/src/github.com/open-cluster-management/cluster-permission | |
| jobs: | |
| build: | |
| name: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
| with: | |
| fetch-depth: 1 | |
| path: go/src/github.com/open-cluster-management/cluster-permission | |
| - name: install Go | |
| uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: pre-build | |
| run: make pre-build | |
| - name: build | |
| run: make build | |
| images: | |
| name: images | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
| with: | |
| fetch-depth: 1 | |
| path: go/src/github.com/open-cluster-management/cluster-permission | |
| - name: install Go | |
| uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: install imagebuilder | |
| run: go install github.com/openshift/imagebuilder/cmd/imagebuilder@v1.2.3 | |
| - name: images | |
| run: make docker-build | |
| test: | |
| name: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
| with: | |
| fetch-depth: 1 | |
| path: go/src/github.com/open-cluster-management/cluster-permission | |
| - name: install Go | |
| uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: test | |
| run: make test | |
| - name: report-coverage | |
| uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: /home/runner/work/cluster-permission/cluster-permission/go/src/github.com/open-cluster-management/cluster-permission/coverage.out | |
| flags: unit | |
| name: unit | |
| verbose: true | |
| fail_ci_if_error: true | |
| go-sec-scan: | |
| name: go-sec-scan | |
| runs-on: ubuntu-latest | |
| env: | |
| GO111MODULE: on | |
| steps: | |
| - name: Checkout Source | |
| uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
| - name: Run Gosec Security Scanner | |
| uses: securego/gosec@caf8857bbd3276599d0176b0528e9712bb0b5bec # master | |
| with: | |
| args: -exclude-generated ./... | |
| env: | |
| GOFLAGS: "-buildvcs=false" | |
| e2e: | |
| name: e2e | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
| with: | |
| fetch-depth: 1 | |
| path: go/src/github.com/open-cluster-management/cluster-permission | |
| - name: install Go | |
| uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: install imagebuilder | |
| run: go install github.com/openshift/imagebuilder/cmd/imagebuilder@v1.2.3 | |
| - name: images | |
| run: make docker-build | |
| - name: setup kind cluster1 | |
| run: kind create cluster --name cluster1 --image kindest/node:${{ env.KUBERNETES_VERSION }} --wait 300s | |
| - name: setup kind hub | |
| run: kind create cluster --name hub --image kindest/node:${{ env.KUBERNETES_VERSION }} --wait 300s | |
| - name: Load image on the nodes of the cluster | |
| run: | | |
| kind load docker-image --name=hub quay.io/open-cluster-management/cluster-permission:latest | |
| - name: Run e2e test | |
| run: | | |
| make test-e2e | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| HUB_KUBECONFIG: /home/runner/.kube/config | |
| SPOKE_KUBECONFIG: /home/runner/.kube/config | |
| SPOKE_CLUSTER_NAME: "cluster1" |