diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..76b7028488 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,87 @@ +name: CI +on: + - push + - pull_request + +env: + GOPROXY: off + GOFLAGS: -mod=vendor + +jobs: + lint: + runs-on: 'windows-2019' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '^1.15.0' + + - run: Invoke-WebRequest "https://github.com/alecthomas/gometalinter/releases/download/v2.0.12/gometalinter-2.0.12-windows-amd64.zip" -OutFile "gometalinter.zip" + - run: 7z x gometalinter.zip -y -oC:\ + - run: gometalinter.exe --config .gometalinter.json ./... + env: + PATH: C:\gometalinter-2.0.12-windows-amd64;{{ env.PATH }} + + test: + runs-on: 'windows-2019' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '^1.15.0' + + - 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 + 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: '^1.15.0' + + - 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 ./internal/tools/grantvmgroupaccess + - 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 diff --git a/README.md b/README.md index d504f18893..824365ea51 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # hcsshim -[![Build status](https://ci.appveyor.com/api/projects/status/nbcw28mnkqml0loa/branch/master?svg=true)](https://ci.appveyor.com/project/WindowsVirtualization/hcsshim/branch/master) +[![Build status](https://github.com/microsoft/hcsshim/actions/workflows/CI/badge.svg?branch=master)](https://github.com/microsoft/hcsshim/actions?query=branch%3Amaster) This package contains the Golang interface for using the Windows [Host Compute Service](https://techcommunity.microsoft.com/t5/containers/introducing-the-host-compute-service-hcs/ba-p/382332) (HCS) to launch and manage [Windows Containers](https://docs.microsoft.com/en-us/virtualization/windowscontainers/about/). It also contains other helpers and functions for managing Windows Containers such as the Golang interface for the Host Network Service (HNS). diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index b7873b0705..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,51 +0,0 @@ -version: 0.1.{build} - -image: Visual Studio 2019 - -clone_folder: c:\gopath\src\github.com\Microsoft\hcsshim - -environment: - GOPATH: c:\gopath - PATH: "%GOPATH%\\bin;C:\\gometalinter-2.0.12-windows-amd64;%PATH%" - GOPROXY: 'off' - GOFLAGS: '-mod=vendor' - -stack: go 1.15 - -build_script: - - appveyor DownloadFile https://github.com/alecthomas/gometalinter/releases/download/v2.0.12/gometalinter-2.0.12-windows-amd64.zip - - 7z x gometalinter-2.0.12-windows-amd64.zip -y -oC:\ > NUL - - gometalinter.exe --config .gometalinter.json ./... - - go build ./cmd/containerd-shim-runhcs-v1 - - go build ./cmd/runhcs - - go build ./cmd/tar2ext4 - - go build ./cmd/wclayer - - go build ./cmd/device-util - - go build ./cmd/ncproxy - - go build ./internal/tools/grantvmgroupaccess - - go build ./internal/tools/uvmboot - - go build ./internal/tools/zapdir - - go test -gcflags=all=-d=checkptr -v ./... -tags admin - - cd test - - go test -gcflags=all=-d=checkptr -v ./internal -tags admin - - go test -gcflags=all=-d=checkptr -c ./containerd-shim-runhcs-v1/ -tags functional - - go test -gcflags=all=-d=checkptr -c ./cri-containerd/ -tags functional - - go test -gcflags=all=-d=checkptr -c ./functional/ -tags functional - - go test -gcflags=all=-d=checkptr -c ./runhcs/ -tags functional - - go build -o sample-logging-driver.exe ./cri-containerd/helpers/log.go - -artifacts: - - path: 'containerd-shim-runhcs-v1.exe' - - path: 'runhcs.exe' - - path: 'tar2ext4.exe' - - path: 'device-util.exe' - - path: 'wclayer.exe' - - path: 'grantvmgroupaccess.exe' - - path: 'uvmboot.exe' - - path: 'zapdir.exe' - - path: 'ncproxy.exe' - - path: './test/containerd-shim-runhcs-v1.test.exe' - - path: './test/cri-containerd.test.exe' - - path: './test/functional.test.exe' - - path: './test/runhcs.test.exe' - - path: './test/sample-logging-driver.exe'