From c5ab5a0fd31a6ee8e98187c64c63ea6c0f4a27cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Thu, 5 Jan 2023 10:37:41 +0100 Subject: [PATCH] chore: small gh workflows improvements (#5883) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché Signed-off-by: Charles-Edouard Brétéché Co-authored-by: shuting --- .github/workflows/cli.yaml | 17 ++++++++--------- .github/workflows/comment-commands.yaml | 6 ++++-- .github/workflows/fossa.yml | 6 ++++-- .github/workflows/pr-update.yaml | 4 ++-- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cli.yaml b/.github/workflows/cli.yaml index df1ade06a9..961cb6989c 100644 --- a/.github/workflows/cli.yaml +++ b/.github/workflows/cli.yaml @@ -1,4 +1,5 @@ name: cli + on: push: branches: @@ -16,25 +17,20 @@ on: - 'README.md' - '.github/config.yml' -permissions: read-all - jobs: cli-test: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0 - - name: Unshallow run: git fetch --prune --unshallow - - name: Set up Go uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 with: go-version: ~1.19.4 - - name: Cache Go modules - uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # pin@v3 + uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2 with: path: | ~/.cache/go-build @@ -42,8 +38,7 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - - name: Test Policy + - name: Setup TEST_GIT_BRANCH run: | if [[ ${{ github.event_name }} == "push" ]] then @@ -52,7 +47,11 @@ jobs: then export TEST_GIT_BRANCH=${{ github.event.pull_request.base.ref }} fi - make -j4 test-cli + - name: Test CLI + run: | + make test-cli + - name: Test CLI (failures) + run: | CLI_PATH=$PWD/cmd/cli/kubectl-kyverno/kubectl-kyverno $CLI_PATH test ./test/cli/test-fail/missing-policy && exit 1 || exit 0 $CLI_PATH test ./test/cli/test-fail/missing-rule && exit 1 || exit 0 diff --git a/.github/workflows/comment-commands.yaml b/.github/workflows/comment-commands.yaml index dc0a4522b5..791dbeb6cc 100644 --- a/.github/workflows/comment-commands.yaml +++ b/.github/workflows/comment-commands.yaml @@ -2,7 +2,9 @@ name: Issue and PR comment commands on: issue_comment: - types: [created, edited] + types: + - created + - edited permissions: issues: write @@ -12,7 +14,7 @@ jobs: execute: runs-on: ubuntu-latest steps: - - uses: jpmcb/prow-github-actions@f4d01dd4b13f289014c23fe5a19878a2479cb35b + - uses: jpmcb/prow-github-actions@f4d01dd4b13f289014c23fe5a19878a2479cb35b # v1.1.3 with: prow-commands: '/assign /unassign diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml index f8af05caf6..48c7ec2a87 100644 --- a/.github/workflows/fossa.yml +++ b/.github/workflows/fossa.yml @@ -2,9 +2,11 @@ name: FOSSA on: push: - branches: [main] + branches: + - main pull_request: - branches: [main] + branches: + - main jobs: build: diff --git a/.github/workflows/pr-update.yaml b/.github/workflows/pr-update.yaml index 0365b37538..8e427bd188 100644 --- a/.github/workflows/pr-update.yaml +++ b/.github/workflows/pr-update.yaml @@ -19,5 +19,5 @@ jobs: base: ${{ github.ref_name }} required_approval_count: 1 require_passed_checks: false - sort: 'updated' - direction: 'asc' + sort: updated + direction: asc