From e08ed0bf7c1754b238cbd0eaca9d3ca30ed70b55 Mon Sep 17 00:00:00 2001 From: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> Date: Wed, 14 Feb 2024 09:55:14 -0500 Subject: [PATCH] Simplify GitHub Action workflows - Removes unnecessary subdirectories in favor of defaults - Also attempts to resolve the `setup-go` caching warnings. Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> --- .github/workflows/go-postsubmit.yml | 14 +------------- .github/workflows/go-release.yml | 9 ++------- .github/workflows/kind.yml | 7 +------ 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/.github/workflows/go-postsubmit.yml b/.github/workflows/go-postsubmit.yml index bcbe766f..74a336b1 100644 --- a/.github/workflows/go-postsubmit.yml +++ b/.github/workflows/go-postsubmit.yml @@ -5,15 +5,6 @@ on: branches: - main - release-* - workflow_dispatch: {} - -env: - # Common versions - GO_REQUIRED_MIN_VERSION: '' - GOPATH: '/home/runner/work/config-policy-controller/config-policy-controller/go' -defaults: - run: - working-directory: go/src/open-cluster-management.io/config-policy-controller jobs: verify: @@ -22,13 +13,10 @@ jobs: steps: - name: checkout code uses: actions/checkout@v4 - with: - fetch-depth: 1 - path: go/src/open-cluster-management.io/config-policy-controller - name: install Go uses: actions/setup-go@v5 with: - go-version-file: go/src/open-cluster-management.io/config-policy-controller/go.mod + go-version-file: go.mod - name: images run: make build-images - name: push diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml index 0cd71f3b..e7c4c0ea 100644 --- a/.github/workflows/go-release.yml +++ b/.github/workflows/go-release.yml @@ -7,9 +7,7 @@ on: env: TAG: ${{ github.ref_name }} -defaults: - run: - working-directory: go/src/open-cluster-management.io/config-policy-controller + jobs: release: @@ -18,13 +16,10 @@ jobs: steps: - name: checkout code uses: actions/checkout@v4 - with: - fetch-depth: 1 - path: go/src/open-cluster-management.io/config-policy-controller - name: install Go uses: actions/setup-go@v5 with: - go-version-file: go/src/open-cluster-management.io/config-policy-controller/go.mod + go-version-file: go.mod - name: build images run: | make build-images diff --git a/.github/workflows/kind.yml b/.github/workflows/kind.yml index 9a90db49..ada05217 100644 --- a/.github/workflows/kind.yml +++ b/.github/workflows/kind.yml @@ -13,7 +13,6 @@ on: defaults: run: shell: bash - working-directory: config-policy-controller jobs: kind-tests: @@ -33,15 +32,11 @@ jobs: steps: - name: Checkout Config Policy Controller uses: actions/checkout@v4 - with: - path: config-policy-controller - fetch-depth: 0 # Fetch all history for all tags and branches - name: Set up Go uses: actions/setup-go@v5 - id: go with: - go-version-file: config-policy-controller/go.mod + go-version-file: go.mod - name: Verify modules run: |