Use Go version associated with containerd release

This ensures that there isn't flakes with testing when go version doesn't match the release as experienced in #147

Signed-off-by: James Sturtevant <jstur@microsoft.com>
This commit is contained in:
James Sturtevant 2023-08-03 19:41:26 +00:00
parent a80d2dfe51
commit 2e3b3ef70e
1 changed files with 16 additions and 5 deletions

View File

@ -100,10 +100,6 @@ jobs:
- name: Checkout extensions - name: Checkout extensions
uses: actions/checkout@v3 uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20.4'
- name: Checkout containerd - name: Checkout containerd
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
@ -111,6 +107,16 @@ jobs:
path: src/github.com/containerd/containerd path: src/github.com/containerd/containerd
ref: ${{ matrix.containerd }} ref: ${{ matrix.containerd }}
- name: Get Go Version
run: |
go_version=$(awk -F': ' '/GO_VERSION/ {gsub(/["'\'']/, "", $2); print $2; exit}' .github/workflows/release.yml)
echo "GO_VERSION=$go_version" >> $GITHUB_ENV
working-directory: src/github.com/containerd/containerd
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Install containerd - name: Install containerd
env: env:
GOFLAGS: -modcacherw GOFLAGS: -modcacherw
@ -122,7 +128,7 @@ jobs:
sudo -E PATH=$PATH script/setup/install-runc sudo -E PATH=$PATH script/setup/install-runc
sudo -E PATH=$PATH script/setup/install-cni $(grep containernetworking/plugins go.mod | awk '{print $2}') sudo -E PATH=$PATH script/setup/install-cni $(grep containernetworking/plugins go.mod | awk '{print $2}')
# Install containerd # Install containerd
make bin/containerd GO_BUILD_FLAGS="-mod=vendor" BUILDTAGS="no_btrfs no_devmapper" sudo -E PATH=$PATH make bin/containerd GO_BUILD_FLAGS="-mod=vendor" BUILDTAGS="no_btrfs no_devmapper"
sudo -E PATH=$PATH install bin/containerd /usr/local/bin/ sudo -E PATH=$PATH install bin/containerd /usr/local/bin/
working-directory: src/github.com/containerd/containerd working-directory: src/github.com/containerd/containerd
@ -131,6 +137,11 @@ jobs:
cargo build --release --bin containerd-shim-runc-v2-rs cargo build --release --bin containerd-shim-runc-v2-rs
sudo install -D ./target/release/containerd-shim-runc-v2-rs /usr/local/bin/ sudo install -D ./target/release/containerd-shim-runc-v2-rs /usr/local/bin/
## get latest go version for integrations tests so we can skip runnings tests
- uses: actions/setup-go@v4
with:
go-version: '1.20.4'
- name: Integration - name: Integration
env: env:
GOPROXY: direct GOPROXY: direct