Enhance workflow

This commit is contained in:
CrazyMax 2021-03-29 13:16:13 +02:00
parent 2cbde9dffa
commit 3868ffb99e
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
10 changed files with 133 additions and 91 deletions

21
hack/test.Dockerfile Normal file
View file

@ -0,0 +1,21 @@
# syntax=docker/dockerfile:1.2
ARG NODE_VERSION
FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache git
WORKDIR /src
FROM base AS deps
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn install
FROM deps AS test
ENV RUNNER_TEMP=/tmp/github_runner
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn run test --coverageDirectory=/tmp/coverage
FROM scratch AS test-coverage
COPY --from=test /tmp/coverage /