Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E buildx tests #996

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,8 @@ jobs:
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }}
- name: Expose GitHub Actions runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Run tests
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{
matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ jobs:
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }}
- name: Expose GitHub Actions runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Run tests
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{
matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ jobs:
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }}
- name: Expose GitHub Actions runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Run tests
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{
matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/run-acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ jobs:
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }}
- name: Expose GitHub Actions runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Run tests
if: matrix.testTarget == 'local'
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{
Expand Down
2 changes: 2 additions & 0 deletions examples/buildx/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM alpine
RUN echo 👍
5 changes: 5 additions & 0 deletions examples/buildx/app/Dockerfile.buildArgs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine

ARG SET_ME_TO_TRUE
RUN [ "$SET_ME_TO_TRUE" = "true" ]
RUN echo "That's the correct build arg, thanks! 👍"
2 changes: 2 additions & 0 deletions examples/buildx/app/Dockerfile.emptyContext
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM alpine
RUN echo "This image doesn't use any local files, so it doesn't need a context parameter 👍"
3 changes: 3 additions & 0 deletions examples/buildx/app/Dockerfile.extraHosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM bash AS base

RUN getent hosts metadata.google.internal
7 changes: 7 additions & 0 deletions examples/buildx/app/Dockerfile.multiPlatform
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM --platform=$BUILDPLATFORM alpine as build
RUN echo ${BUILDPLATFORM} > buildplatform
RUN echo ${TARGETPLATFORM} > targetplatform

FROM build
RUN cat buildplatform
RUN cat targetplatform
5 changes: 5 additions & 0 deletions examples/buildx/app/Dockerfile.namedContexts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# syntax=docker/dockerfile:1.4
FROM golang:latest

RUN version="$(go version)" && echo $version && [ "$version" = "go version go1.21.7 linux/amd64" ]
RUN echo "This image uses named contexts to pin golang:latest to a specific SHA 👍"
4 changes: 4 additions & 0 deletions examples/buildx/app/Dockerfile.secrets
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM alpine

RUN --mount=type=secret,id=password [ "$(cat /run/secrets/password)" = "hunter2" ]

5 changes: 5 additions & 0 deletions examples/buildx/app/Dockerfile.sshMount
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine

RUN apk add openssh-client

RUN --mount=type=ssh ssh-add -l
8 changes: 8 additions & 0 deletions examples/buildx/app/Dockerfile.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM alpine as build-me
RUN echo 👍

FROM build-me as also-build-me
RUN echo 🤙

FROM build-me as dont-build-me
RUN [ "true" = "false" ]
Loading
Loading