-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build working Windows container images
Add e2e tests that run on Windows and cover kodata behavior
- Loading branch information
Showing
9 changed files
with
181 additions
and
61 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,45 @@ | ||
name: Basic e2e test | ||
|
||
on: | ||
pull_request: | ||
branches: ['main'] | ||
|
||
jobs: | ||
e2e: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- ubuntu-latest | ||
- windows-latest | ||
name: e2e ${{ matrix.platform }} | ||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16.x | ||
|
||
- name: Build and run ko container | ||
env: | ||
KO_DOCKER_REPO: ko.local | ||
shell: bash | ||
run: | | ||
set -euxo pipefail | ||
# eval `go env`, compatible with Windows and Linux | ||
# cribbed from https://gist.github.com/Syeberman/39d81b1e17d091be5657ecd6fbff0753 | ||
eval $(go env | sed -r 's/^(set )?(\w+)=("?)(.*)\3$/\2="\4"/gm') | ||
if [[ "${{ matrix.platform }}" == "windows-latest" ]]; then | ||
export KO_DEFAULTBASEIMAGE=mcr.microsoft.com/windows/nanoserver:1809 | ||
fi | ||
echo platform is ${GOOS}/${GOARCH} | ||
# Build and run the ko binary, which should be runnable. | ||
docker run $(go run ./ publish ./ --platform=${GOOS}/${GOARCH} --preserve-import-paths) version | ||
# Build and run the test/ binary, which should log "Hello there" served from KO_DATA_PATH | ||
docker run $(go run ./ publish ./test --platform=${GOOS}/${GOARCH} --preserve-import-paths) --wait=false 2>&1 | grep "Hello there" | ||
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,3 +1,4 @@ | ||
# Ignore GoLand (IntelliJ) files. | ||
.idea/ | ||
|
||
ko |
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.