github-ci: use go1.19.x (#1689) #4068
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
- push | |
- pull_request | |
env: | |
GOFLAGS: -mod=vendor | |
GOPROXY: off | |
GO_VERSION: '1.19.x' | |
jobs: | |
lint: | |
runs-on: 'windows-2019' | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v2 | |
with: | |
version: v1.48 | |
args: --timeout=5m -v | |
skip-go-installation: true | |
only-new-issues: true | |
verify-main-vendor: | |
runs-on: 'windows-2019' | |
env: | |
GOPROXY: "https://proxy.golang.org,direct" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Validate main modules | |
shell: powershell | |
run: | | |
$currentPath = (Get-Location).Path | |
$process = Start-Process powershell.exe -PassThru -Verb runAs -Wait -ArgumentList $currentPath/scripts/Verify-GoModules.ps1, $currentPath | |
if ($process.ExitCode -ne 0) { | |
Write-Error "Main modules are not up to date. Please validate your go version >= this job's and run `go mod vendor` followed by `go mod tidy` in the repo root path." | |
} | |
exit $process.ExitCode | |
verify-test-vendor: | |
runs-on: 'windows-2019' | |
env: | |
GOPROXY: "https://proxy.golang.org,direct" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Validate test modules | |
shell: powershell | |
run: | | |
$currentPath = (Get-Location).Path | |
$process = Start-Process powershell.exe -PassThru -Verb runAs -Wait -ArgumentList $currentPath/scripts/Verify-GoModules.ps1, $currentPath, "test" | |
if ($process.ExitCode -ne 0) { | |
Write-Error "Test package modules are not up to date. Please validate your go version >= this job's and run `go mod vendor` followed by `go mod tidy` in hcsshim/test directory." | |
} | |
exit $process.ExitCode | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-2019, windows-2022] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- run: go test -gcflags=all=-d=checkptr -v ./... -tags admin | |
- run: go test -gcflags=all=-d=checkptr -v ./internal -tags admin | |
working-directory: test | |
- run: go test -gcflags=all=-d=checkptr -c ./containerd-shim-runhcs-v1/ -tags functional | |
working-directory: test | |
- run: go test -gcflags=all=-d=checkptr -c ./cri-containerd/ -tags functional | |
working-directory: test | |
- run: go test -gcflags=all=-d=checkptr -c ./functional/ -tags functional | |
working-directory: test | |
- run: go test -gcflags=all=-d=checkptr -c ./runhcs/ -tags functional | |
working-directory: test | |
- run: go build -o sample-logging-driver.exe ./cri-containerd/helpers/log.go | |
working-directory: test | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: test_binaries_${{ matrix.os }} | |
path: | | |
test/containerd-shim-runhcs-v1.test.exe | |
test/cri-containerd.test.exe | |
test/functional.test.exe | |
test/runhcs.test.exe | |
test/sample-logging-driver.exe | |
build: | |
runs-on: 'windows-2019' | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- run: go build ./cmd/containerd-shim-runhcs-v1 | |
- run: go build ./cmd/runhcs | |
- run: go build ./cmd/tar2ext4 | |
- run: go build ./cmd/wclayer | |
- run: go build ./cmd/device-util | |
- run: go build ./cmd/ncproxy | |
- run: go build ./cmd/dmverity-vhd | |
- run: go build ./internal/tools/grantvmgroupaccess | |
- run: go build ./internal/tools/securitypolicy | |
- run: go build ./internal/tools/uvmboot | |
- run: go build ./internal/tools/zapdir | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: binaries | |
path: | | |
containerd-shim-runhcs-v1.exe | |
runhcs.exe | |
tar2ext4.exe | |
device-util.exe | |
wclayer.exe | |
grantvmgroupaccess.exe | |
uvmboot.exe | |
zapdir.exe | |
ncproxy.exe | |
build_gcs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Pull busybox image | |
run: docker pull busybox | |
- name: Run Busybox Container | |
run: docker run --name base_image_container busybox | |
- name: Export container to tar file | |
run: | | |
docker export base_image_container | gzip > base.tar.gz | |
- name: Build And Test | |
run: | | |
BASE=./base.tar.gz | |
make all test |