Try removing .git
exception
#1155
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
name: MinKinD Run E2Es | |
on: | |
pull_request: | |
branches: [ master ] | |
# schedule: | |
# - cron: '0 */3 * * *' | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./src/github.com/mattmoor/mink | |
jobs: | |
cli-tests: | |
name: e2e tests | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false # Keep running if one leg fails. | |
matrix: | |
k8s-version: | |
- v1.22.x | |
env: | |
GOPATH: ${{ github.workspace }} | |
GO111MODULE: on | |
GOFLAGS: -ldflags=-s -ldflags=-w -mod=vendor -tags=nostackdriver | |
GGCR_EXPERIMENT_ESTARGZ: "1" | |
KO_DOCKER_REPO: registry.local:5000/knative | |
GATEWAY_OVERRIDE: kourier | |
GATEWAY_NAMESPACE_OVERRIDE: mink-system | |
SYSTEM_NAMESPACE: mink-system | |
ARTIFACTS: ${{ github.workspace }}/artifacts | |
steps: | |
- name: Set up Go 1.17.x | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17.x | |
- name: Install Dependencies | |
working-directory: ./ | |
run: | | |
echo '::group:: install ko' | |
curl -L https://github.com/google/ko/releases/download/v0.8.3/ko_0.8.3_Linux_x86_64.tar.gz | tar xzf - ko | |
chmod +x ./ko | |
sudo mv ko /usr/local/bin | |
echo '::endgroup::' | |
- name: Check out mink | |
uses: actions/checkout@v3 | |
with: | |
path: ./src/github.com/mattmoor/mink | |
- name: Setup Cluster | |
working-directory: ./src/github.com/mattmoor/mink | |
run: | | |
./hack/setup-kind.sh \ | |
--registry-url $(echo ${KO_DOCKER_REPO} | cut -d'/' -f 1) \ | |
--cluster-suffix c${{ github.run_id }}.local \ | |
--nodes 3 \ | |
--k8s-version ${{ matrix.k8s-version }} | |
- name: Install mink core | |
run: | | |
./hack/build.sh | |
# Use mink to install things. | |
mink install --replicas=3 | |
cat > $HOME/.mink.yaml <<EOF | |
# Bundle source context to here by default! | |
bundle: ${KO_DOCKER_REPO}/bundle:latest | |
# Send the resulting image here by default! | |
image: | | |
{{ if eq .Scheme "ko" }} | |
${KO_DOCKER_REPO}/{{ lower (join "ko-images" .Host .Path) }} | |
{{ else if eq .Scheme "buildpack" }} | |
${KO_DOCKER_REPO}/{{ lower (join "buildpack-images" .Host .Path) }} | |
{{ else if eq .Scheme "dockerfile" }} | |
${KO_DOCKER_REPO}/{{ lower (join "dockerfile-images" .Host .Path) }} | |
{{ else if eq .Scheme "task" }} | |
${KO_DOCKER_REPO}/{{ lower (join "task-images" .Host .Path) }} | |
{{ else if eq .Scheme "pipeline" }} | |
${KO_DOCKER_REPO}/{{ lower (join "pipeline-images" .Host .Path) }} | |
{{ else }} | |
BREAK THINGS | |
{{ end }} | |
EOF | |
- name: "Smoke Test: mink run task" | |
working-directory: ./src/github.com/mattmoor/mink | |
run: | | |
# Apply the sample task definition. | |
kubectl apply -f examples/task-hello.yaml -f examples/task-bundle.yaml -f examples/task-image.yaml -f examples/task-echo.yaml | |
NAME=${RANDOM} | |
echo '::group:: Test w/o optional parameters' | |
WANT="Hello, ${NAME}" | |
GOT=$(mink run task hello -- --name ${NAME} -omessage) | |
if [[ "${GOT}" != "${WANT}" ]]; then | |
echo Got: ${GOT}, wanted ${WANT}. | |
exit 1 | |
fi | |
echo '::endgroup::' | |
echo '::group:: Test w/ optional parameters' | |
WANT="Hola, ${NAME}" | |
GOT=$(mink run task hello -- --name ${NAME} --greeting Hola -omessage) | |
if [[ "${GOT}" != "${WANT}" ]]; then | |
echo Got: ${GOT}, wanted ${WANT}. | |
exit 1 | |
fi | |
echo '::endgroup::' | |
echo '::group:: Test w/ bundle' | |
WANT="${RANDOM}" | |
echo ${WANT} > the-file-name | |
GOT=$(mink run task --as=me hello-bundles -- --the-file the-file-name -ocontents) | |
if [[ "${GOT}" != "${WANT}" ]]; then | |
echo Got: ${GOT}, wanted ${WANT}. | |
exit 1 | |
fi | |
rm the-file-name | |
echo '::endgroup::' | |
echo '::group:: Test w/ image' | |
WANT="${KO_DOCKER_REPO}/task-images" | |
GOT=$(mink run task --as=me hello-image -- -oimage) | |
if [[ "${GOT}" != "${WANT}" ]]; then | |
echo Got: ${GOT}, wanted ${WANT}. | |
exit 1 | |
fi | |
echo '::endgroup::' | |
echo '::group:: Test w/ array params' | |
WANT="$(echo 'foo bar')" | |
GOT="$(mink run task echo -- --word foo --word bar 2>&1 | grep foo)" | |
if [[ "${GOT}" != "${WANT}" ]]; then | |
echo Got: ${GOT}, wanted ${WANT}. | |
exit 1 | |
fi | |
echo '::endgroup::' | |
- name: "Smoke Test: mink run pipeline" | |
working-directory: ./src/github.com/mattmoor/mink | |
run: | | |
# Apply the sample task definition. | |
kubectl apply -f examples/pipeline-hello.yaml -f examples/pipeline-bundle.yaml -f examples/pipeline-image.yaml | |
NAME=${RANDOM} | |
echo '::group:: Test w/o optional parameters' | |
WANT="Hello, ${NAME}" | |
GOT=$(mink run pipeline hello-and-goodbye -- --name ${NAME} -ogreeting-message) | |
if [[ "${GOT}" != "${WANT}" ]]; then | |
echo Got: ${GOT}, wanted ${WANT}. | |
exit 1 | |
fi | |
echo '::endgroup::' | |
echo '::group:: Test w/ optional parameters' | |
WANT="Adios, ${NAME}" | |
GOT=$(mink run pipeline hello-and-goodbye -- --name ${NAME} --greeting Aloha --farewell Adios -ofarewell-message) | |
if [[ "${GOT}" != "${WANT}" ]]; then | |
echo Got: ${GOT}, wanted ${WANT}. | |
exit 1 | |
fi | |
echo '::endgroup::' | |
echo '::group:: Test w/ bundle' | |
echo ${RANDOM} > the-file-name | |
WANT="Hello, $(cat the-file-name)" | |
GOT=$(mink run pipeline --as=me hello-bundles -- --the-file the-file-name -omessage) | |
if [[ "${GOT}" != "${WANT}" ]]; then | |
echo Got: ${GOT}, wanted ${WANT}. | |
exit 1 | |
fi | |
rm the-file-name | |
echo '::endgroup::' | |
echo '::group:: Test w/ image' | |
WANT="Hello, ${KO_DOCKER_REPO}/pipeline-images" | |
GOT=$(mink run pipeline --as=me hello-image -- -omessage) | |
if [[ "${GOT}" != "${WANT}" ]]; then | |
echo Got: ${GOT}, wanted ${WANT}. | |
exit 1 | |
fi | |
echo '::endgroup::' | |
- name: "e2e Test: mink run task" | |
working-directory: ./src/github.com/mattmoor/mink | |
run: | | |
kubectl apply -f examples/kaniko.yaml | |
echo '::group:: Build kuard' | |
mink run task --as=me kaniko --git-url=https://github.com/kubernetes-up-and-running/kuard.git | |
echo '::endgroup::' | |
- uses: chainguard-dev/actions/kind-diag@main | |
if: ${{ failure() }} |