workflows: static-checks: Set GOPATH only once

{{ runner.workspace }}/kata-containers and {{ github.workspace }} resolve to
the same value, but they're being used multiple times in the workflow. Remove
multiple definitions and define the GOPATH var at job level once.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
Jeremi Piotrowski 2023-03-03 11:23:42 +01:00
parent 439ff9d4c4
commit e68186d9af

View File

@ -21,6 +21,7 @@ jobs:
env: env:
RUST_BACKTRACE: "1" RUST_BACKTRACE: "1"
target_branch: ${{ github.base_ref }} target_branch: ${{ github.base_ref }}
GOPATH: ${{ github.workspace }}
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -31,8 +32,6 @@ jobs:
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19.3 go-version: 1.19.3
env:
GOPATH: ${{ runner.workspace }}/kata-containers
- name: Check kernel config version - name: Check kernel config version
run: | run: |
cd "${{ github.workspace }}/src/github.com/${{ github.repository }}" cd "${{ github.workspace }}/src/github.com/${{ github.repository }}"
@ -48,17 +47,14 @@ jobs:
fi fi
echo "Check passed" echo "Check passed"
fi fi
- name: Set env - name: Set PATH
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }} if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
run: | run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Setup - name: Setup
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }} if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
run: | run: |
cd ${GOPATH}/src/github.com/${{ github.repository }} && ./ci/setup.sh cd ${GOPATH}/src/github.com/${{ github.repository }} && ./ci/setup.sh
env:
GOPATH: ${{ runner.workspace }}/kata-containers
- name: Installing rust - name: Installing rust
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }} if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
run: | run: |