From c6c2dc700b189aa1eaf02f032fb73471c6a6a7cc Mon Sep 17 00:00:00 2001 From: Brandon Palm Date: Tue, 4 Jun 2024 13:17:41 -0500 Subject: [PATCH] ci: add eco-goinfra compatibility check --- .github/workflows/eco-goinfra-integration.yml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/eco-goinfra-integration.yml diff --git a/.github/workflows/eco-goinfra-integration.yml b/.github/workflows/eco-goinfra-integration.yml new file mode 100644 index 000000000..9afab9a09 --- /dev/null +++ b/.github/workflows/eco-goinfra-integration.yml @@ -0,0 +1,48 @@ +name: eco-goinfra integration + +on: + workflow_dispatch: + pull_request: + branches: + - main + - 'release-\d.\d\d' + +jobs: + build: + runs-on: ubuntu-22.04 + env: + SHELL: /bin/bash + ECO_GOINFRA_PATH: goinfra + ECO_GOINFRA_REPO: openshift-kni/eco-goinfra + + steps: + - name: Set up Go 1.22 + if: ${{ !contains(github.event.*.labels.*.name, 'ignore-dep-check') }} + uses: actions/setup-go@v5 + with: + go-version: 1.22.3 + + - name: Check out the eco-goinfra code + if: ${{ !contains(github.event.*.labels.*.name, 'ignore-dep-check') }} + uses: actions/checkout@v4 + + - name: Check out the eco-goinfra code + if: ${{ !contains(github.event.*.labels.*.name, 'ignore-dep-check') }} + uses: actions/checkout@v4 + with: + repository: ${{ env.ECO_GOINFRA_REPO }} + # check out the branch name that is targeted by the PR + ref: ${{ github.base_ref }} + path: ${{ env.ECO_GOINFRA_PATH }} + + # Update the go.mod file in eco-gotests to include the current eco-goinfra code + - name: Update go.mod in eco-gotests + if: ${{ !contains(github.event.*.labels.*.name, 'ignore-dep-check') }} + run: | + go mod edit -replace github.com/openshift-kni/eco-goinfra=${{ env.ECO_GOINFRA_PATH }} + go mod tidy + go mod vendor + + - name: eco-goinfra go vet + if: ${{ !contains(github.event.*.labels.*.name, 'ignore-dep-check') }} + run: make vet