Skip to content

Commit

Permalink
add integration tests for alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
steebchen committed Jun 21, 2023
1 parent a68a9ce commit 78c7e69
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 8 additions & 4 deletions test/integration/integration.dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 78c7e69

Please sign in to comment.