forked from ko-build/ko
-
Notifications
You must be signed in to change notification settings - Fork 0
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 (ko-build#374)
* Build working Windows container images Add e2e tests that run on Windows and cover kodata behavior * now successfully skipping symlinks on windows :-/ * fix e2e test on windows, that relied on a symlink in kodata after all * document windows symlink issue * review feedback * re-add kodata symlink tests for linux
- Loading branch information
Showing
10 changed files
with
188 additions
and
70 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,51 @@ | ||
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 | ||
testimg=$(go run ./ publish ./test --platform=${GOOS}/${GOARCH} --preserve-import-paths) | ||
docker run ${testimg} --wait=false 2>&1 | grep "Hello there" | ||
# Check that symlinks in kodata are chased. | ||
# Skip this test on Windows. | ||
if [[ "$RUNNER_OS" == "Linux" ]]; then | ||
docker run ${testimg} --wait=false -f HEAD | ||
fi |
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
Oops, something went wrong.