Add unit and api tests to Earthfile

This commit is contained in:
Gabe Kangas 2022-06-21 12:16:44 -07:00
parent 86305c3028
commit 2cd6756d01
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA

View File

@ -97,7 +97,6 @@ package:
ARG NAME=custom ARG NAME=custom
END END
COPY (+build/webroot --platform $TARGETPLATFORM) /build/dist/webroot
COPY (+build/owncast --platform $TARGETPLATFORM) /build/dist/owncast COPY (+build/owncast --platform $TARGETPLATFORM) /build/dist/owncast
COPY (+build/README.md --platform $TARGETPLATFORM) /build/dist/README.md COPY (+build/README.md --platform $TARGETPLATFORM) /build/dist/README.md
ENV ZIPNAME owncast-$version-$NAME.zip ENV ZIPNAME owncast-$version-$NAME.zip
@ -116,3 +115,16 @@ docker:
ENTRYPOINT ["/app/owncast"] ENTRYPOINT ["/app/owncast"]
EXPOSE 8080 1935 EXPOSE 8080 1935
SAVE IMAGE --push $image:$tag SAVE IMAGE --push $image:$tag
unit-tests:
FROM --platform=linux/amd64 bdwyertech/go-crosscompile
COPY . /build
WORKDIR /build
RUN go test ./...
api-tests:
FROM --platform=linux/amd64 bdwyertech/go-crosscompile
RUN apk add ffmpeg npm
COPY . /build
WORKDIR /build
RUN cd test/automated/api && ./run.sh