-
Notifications
You must be signed in to change notification settings - Fork 786
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Casey Callendrello <cdc@redhat.com>
- Loading branch information
Showing
6 changed files
with
96 additions
and
43 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
name: test | ||
|
||
on: ["push", "pull_request"] | ||
|
||
env: | ||
GO_VERSION: "1.14" | ||
LINUX_ARCHES: "amd64 386 arm arm64 s390x mips64le ppc64le" | ||
|
||
jobs: | ||
build: | ||
if: "false" | ||
name: Build all linux architectures | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: setup go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build on all supported architectures | ||
run: | | ||
set -e | ||
for arch in ${LINUX_ARCHES}; do | ||
echo "Building for arch $arch" | ||
GOARCH=$arch ./build_linux.sh | ||
rm bin/* | ||
done | ||
test-linux: | ||
if: "false" | ||
name: Run tests on Linux | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: setup go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install test binaries | ||
env: | ||
GO111MODULE: off | ||
run: | | ||
go get github.com/containernetworking/cni/cnitool | ||
go get github.com/mattn/goveralls | ||
go get github.com/modocache/gover | ||
- name: test | ||
run: PATH=$PATH:$(go env GOPATH)/bin COVERALLS=1 ./test_linux.sh | ||
|
||
- name: Send coverage to coveralls | ||
env: | ||
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
PATH=$PATH:$(go env GOPATH)/bin | ||
gover | ||
goveralls -coverprofile=gover.coverprofile -service=github | ||
test-win: | ||
name: Run tests on Windows | ||
runs-on: windows-latest | ||
steps: | ||
- name: setup go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- uses: actions/checkout@v2 | ||
- name: test | ||
run: bash ./test_windows.sh |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,18 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
cd $(dirname "$0") | ||
set -ex | ||
|
||
ORG_PATH="github.com/containernetworking" | ||
export REPO_PATH="${ORG_PATH}/plugins" | ||
|
||
export GOPATH=$(mktemp -d) | ||
mkdir -p ${GOPATH}/src/${ORG_PATH} | ||
trap "{ rm -rf $GOPATH; }" EXIT | ||
ln -s ${PWD} ${GOPATH}/src/${REPO_PATH} || exit 255 | ||
pwd | ||
ls | ||
|
||
export GO="${GO:-go}" | ||
export GOOS=windows | ||
export GOFLAGS="${GOFLAGS} -mod=vendor" | ||
echo $GOFLAGS | ||
echo "$GOFLAGS" | ||
|
||
PLUGINS=$(cat plugins/windows_only.txt) | ||
PLUGINS=$(cat plugins/windows_only.txt | dos2unix ) | ||
echo "$PLUGINS" | ||
for d in $PLUGINS; do | ||
if [ -d "$d" ]; then | ||
plugin="$(basename "$d").exe" | ||
echo " $plugin" | ||
$GO build -o "${PWD}/bin/$plugin" "$@" "$REPO_PATH"/$d | ||
fi | ||
plugin="$(basename "$d").exe" | ||
echo "building $plugin" | ||
$GO build -o "${PWD}/bin/$plugin" "$@" ./"${d}" | ||
done |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
plugins/ipam/host-local | ||
plugins/main/windows/win-bridge | ||
plugins/main/windows/win-overlay | ||
plugins/meta/flannel | ||
plugins/meta/flannel |
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
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