From 78c7e697118aadb631e6d97551a284f032f3d1fc Mon Sep 17 00:00:00 2001 From: steebchen Date: Wed, 21 Jun 2023 22:54:18 +0100 Subject: [PATCH] add integration tests for alpine --- .github/workflows/integration-test.yml | 8 ++++++-- test/integration/integration.dockerfile | 12 ++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 4372f1d0b..70bf2fb7f 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -43,6 +43,10 @@ jobs: restore-keys: ${{ runner.os }}-go- key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - - name: integration + - name: test on golang image if: steps.changes.outputs.go == 'true' - run: docker build . -f test/integration/integration.dockerfile -t integration && docker run integration + run: docker build . --build-arg IMAGE="golang:1.20" -f test/integration/integration.dockerfile -t integration && docker run integration + + - name: test on golang alpine image + if: steps.changes.outputs.go == 'true' + run: docker build . --build-arg IMAGE="golang:1.20-alpine" -f test/integration/integration.dockerfile -t integration && docker run integration diff --git a/test/integration/integration.dockerfile b/test/integration/integration.dockerfile index d73a7bbf6..299e3d38c 100644 --- a/test/integration/integration.dockerfile +++ b/test/integration/integration.dockerfile @@ -1,23 +1,27 @@ -FROM golang:1.20.5 as build +ARG IMAGE +FROM $IMAGE as build WORKDIR /app +RUN go version + ENV PRISMA_CLIENT_GO_LOG=info ENV DEBUG=* +COPY go.mod go.sum ./ +RUN go mod download -x + COPY . ./ WORKDIR /app/test/integration -RUN go mod download -x - RUN go run github.com/steebchen/prisma-client-go db push --schema schemax.prisma # build the integration binary with all dependencies RUN go build -o /app/main . # start a new stage to test if the runtime fetching works -FROM golang:1.20.5 +FROM $IMAGE WORKDIR /app