Skip to content

Commit

Permalink
Use Go version associated with containerd release
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jsturtevant committed Aug 21, 2023
1 parent a80d2df commit 2e3b3ef
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,23 @@ jobs:
- name: Checkout extensions
uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-version: '1.20.4'

- name: Checkout containerd
uses: actions/checkout@v3
with:
repository: containerd/containerd
path: src/github.com/containerd/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
env:
GOFLAGS: -modcacherw
Expand All @@ -122,7 +128,7 @@ jobs:
sudo -E PATH=$PATH script/setup/install-runc
sudo -E PATH=$PATH script/setup/install-cni $(grep containernetworking/plugins go.mod | awk '{print $2}')
# 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/
working-directory: src/github.com/containerd/containerd

Expand All @@ -131,6 +137,11 @@ jobs:
cargo build --release --bin containerd-shim-runc-v2-rs
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
env:
GOPROXY: direct
Expand Down

0 comments on commit 2e3b3ef

Please sign in to comment.