Move Windows testing to GH Actions

This eliminates the need for appveyor.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2020-05-26 16:09:59 -07:00
parent 3226283470
commit c376f4f763
2 changed files with 68 additions and 66 deletions

View File

@ -1,64 +0,0 @@
version: "{build}"
image: Visual Studio 2017
clone_folder: c:\gopath\src\github.com\containerd\containerd
branches:
only:
- master
- /release\/.*/
environment:
GOPATH: C:\gopath
CGO_ENABLED: 0
matrix:
- GO_VERSION: 1.13.11
before_build:
- choco install --no-progress -y mingw --version 5.3.0
# Install Go
- rd C:\Go /s /q
- appveyor DownloadFile https://storage.googleapis.com/golang/go%GO_VERSION%.windows-amd64.zip
- 7z x go%GO_VERSION%.windows-amd64.zip -oC:\ >nul
- go version
- choco install --no-progress codecov
# Clone hcsshim at the vendored version
- bash.exe -elc "export PATH=/c/tools/mingw64/bin:$PATH;
rm -rf /c/gopath/src/github.com/Microsoft/hcsshim;
git clone -q https://github.com/Microsoft/hcsshim.git /c/gopath/src/github.com/Microsoft/hcsshim;
export HCSSHIM_VERSION=`grep Microsoft/hcsshim vendor.conf | awk '{print $2}'`;
echo Using Microsoft/hcsshim $HCSSHIM_VERSION;
pushd /c/gopath/src/github.com/Microsoft/hcsshim;
git checkout $HCSSHIM_VERSION;
popd"
# Print host version. TODO: Remove this when containerd has a way to get host version
- ps: $psversiontable
build_script:
# Build containerd-shim-runhcs-v1.exe and runhcs.exe from Microsoft/hcsshim
- bash.exe -elc "export PATH=/c/tools/mingw64/bin:$PATH;
export GOBIN=/c/gopath/src/github.com/Microsoft/hcsshim/bin;
mkdir $GOBIN;
pushd /c/gopath/src/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1;
go install;
cd ../runhcs;
go install;
ls -al $GOBIN;
popd"
- bash.exe -elc "export PATH=/c/tools/mingw64/bin:/c/gopath/bin:$PATH;
script/setup/install-dev-tools;
mingw32-make.exe check"
- bash.exe -elc "export PATH=/c/tools/mingw64/bin:$PATH ; mingw32-make.exe build binaries"
# These scripts run with CGO_ENABLED=1 in order to support the Race Detector (-race flag), enabled in Makefile.windows
test_script:
# TODO: need an equivalent of TRAVIS_COMMIT_RANGE
# - GIT_CHECK_EXCLUDE="./vendor" TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" C:\MinGW\bin\mingw32-make.exe dco
- bash.exe -lc "export CGO_ENABLED=1 PATH=/c/tools/mingw64/bin:/c/gopath/src/github.com/containerd/containerd/bin:$PATH ; mingw32-make.exe coverage root-coverage"
# - bash.exe -elc "export CGO_ENABLED=1 PATH=/c/tools/mingw64/bin:/c/gopath/src/github.com/containerd/containerd/bin:$PATH ; mingw32-make.exe integration"
# Run the integration suite a second time. See discussion in github.com/containerd/containerd/pull/1759
# - bash.exe -elc "export CGO_ENABLED=1 PATH=/c/tools/mingw64/bin:/c/gopath/src/github.com/containerd/containerd/bin:$PATH; TESTFLAGS_PARALLEL=1 mingw32-make.exe integration"
on_success:
- codecov --flag windows -f coverage.txt

View File

@ -249,8 +249,74 @@ jobs:
# #
# Integration and CRI tests # Integration and CRI tests
# #
integration: integration-windows:
name: Integration name: Windows Integration
runs-on: windows-2019
timeout-minutes: 30
needs: [project, linters, protos, man]
strategy:
matrix:
runtime: [v1]
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: '1.13.11'
- name: Set env
shell: bash
run: |
echo "::set-env name=GOPATH::${{ github.workspace }}"
echo "::add-path::${{ github.workspace }}/src/github.com/containerd/containerd/bin"
- name: Checkout containerd
uses: actions/checkout@v2
with:
path: src/github.com/containerd/containerd
- name: Checkout Microsoft/hcsshim
uses: actions/checkout@v2
with:
repository: Microsoft/hcsshim
path: src/github.com/Microsoft/hcsshim
- name: Install Build Deps
shell: bash
run: |
cd src/github.com/containerd/containerd
script/setup/install-dev-tools
- name: Binaries
shell: bash
run: |
set -o xtrace
export CGO_ENABLED=1
cd src/github.com/containerd/containerd
mingw32-make.exe binaries
bindir="$(pwd)"
SHIM_COMMIT=$(grep Microsoft/hcsshim vendor.conf | awk '{print $2}')
cd ../../Microsoft/hcsshim
git fetch --tags origin "${SHIM_COMMIT}"
git checkout "${SHIM_COMMIT}"
GO111MODULE=on go build -mod=vendor -o "${bindir}/containerd-shim-runhcs-v1.exe" ./cmd/containerd-shim-runhcs-v1
- name: Integration 1
shell: bash
run: |
cp src/github.com/Microsoft/hcsshim/test/functional/manifest/rsrc_amd64.syso src/github.com/containerd/containerd/
cd src/github.com/containerd/containerd
export CGO_ENABLED=1
mingw32-make.exe integration
# Run the integration suite a second time. See discussion in github.com/containerd/containerd/pull/175
- name: Integration 2
shell: bash
run: |
cd src/github.com/containerd/containerd
export TESTFLAGS_PARALLEL=1
export CGO_ENABLED=1
mingw32-make.exe integration
integration-linux:
name: Linux Integration
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
timeout-minutes: 15 timeout-minutes: 15
needs: [project, linters, protos, man] needs: [project, linters, protos, man]