From d10bd0b9d1cb253a0233951bbc1806dcb16a970f Mon Sep 17 00:00:00 2001 From: Kirtana Ashok Date: Thu, 31 Aug 2023 13:18:07 -0700 Subject: [PATCH] Checkout appropriate containerd ref Signed-off-by: Kirtana Ashok --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed5ca0575d..bda217e2aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,12 +56,28 @@ jobs: - uses: actions/checkout@v3 with: path: "go/src/github.com/Microsoft/hcsshim" + name: Checkout hcsshim + + - name: Get containerd ref + shell: powershell + run: | + $v = go list -m -f '{{ .Version }}' 'github.com/containerd/containerd' 2>&1 + if ( $LASTEXITCODE ) { + Write-Output '::error::Could not retrieve containerd version.' + exit $LASTEXITCODE + } + Write-Output "containerd ref is: $v" + "containerd_ref=$v" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + working-directory: go/src/github.com/Microsoft/hcsshim + # Install protoc-gen-gogoctrd in D:\bin - uses: actions/checkout@v3 with: repository: containerd/containerd - ref: v1.6.2 path: "containerd" + ref: "${{ env.containerd_ref }}" + name: Checkout containerd + - name: Install protoc-gen-gogoctrd shell: powershell run: | @@ -69,6 +85,7 @@ jobs: go build ./cmd/protoc-gen-gogoctrd mkdir D:\bin mv protoc-gen-gogoctrd.exe D:\bin + # Install protoc in D:\bin - name: Install protoc shell: powershell @@ -77,6 +94,7 @@ jobs: Expand-Archive -Path protoc.zip -DestinationPath . mv include go/src/github.com/Microsoft/hcsshim/protobuf mv bin\protoc.exe D:\bin + - name: Run Protobuild shell: powershell run: | @@ -260,12 +278,27 @@ jobs: - uses: actions/checkout@v3 with: - path: src/github.com/containerd/containerd - repository: "containerd/containerd" + path: src/github.com/Microsoft/hcsshim + name: Checkout hcsshim + + - name: Get containerd ref + shell: powershell + run: | + $v = go list -m -f '{{ .Version }}' 'github.com/containerd/containerd' 2>&1 + if ( $LASTEXITCODE ) { + Write-Output '::error::Could not retrieve containerd version.' + exit $LASTEXITCODE + } + Write-Output "containerd ref is: $v" + "containerd_ref=$v" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + working-directory: src/github.com/Microsoft/hcsshim - uses: actions/checkout@v3 with: - path: src/github.com/Microsoft/hcsshim + path: src/github.com/containerd/containerd + repository: "containerd/containerd" + ref: "${{ env.containerd_ref }}" + name: Checkout containerd - name: Install crictl shell: powershell