Move test into main Docker build

pull/100/head
Michael Hansen 1 year ago
parent 99f0936789
commit 8b3dfc20dd

@ -0,0 +1,5 @@
*
!Makefile
!src/cpp/
!local/en-us/lessac/low/en-us-lessac-low.onnx
!local/en-us/lessac/low/en-us-lessac-low.onnx.json

@ -47,6 +47,24 @@ RUN mkdir -p piper && \
# -----------------------------------------------------------------------------
FROM scratch
FROM debian:buster as test
ARG TARGETARCH
ARG TARGETVARIANT
WORKDIR /test
COPY local/en-us/lessac/low/en-us-lessac-low.onnx \
local/en-us/lessac/low/en-us-lessac-low.onnx.json ./
COPY --from=build /dist/piper_*.tar.gz ./
RUN tar -xzf piper*.tar.gz
RUN echo 'This is a test.' | ./piper/piper -m en-us-lessac-low.onnx -f test.wav
RUN if [ ! -f test.wav ]; then exit 1; fi
RUN size="$(wc -c < test.wav)"; \
if [ "${size}" -lt "1000" ]; then echo "File size is ${size} bytes"; exit 1; fi
# -----------------------------------------------------------------------------
FROM scratch
COPY --from=test /test/piper_*.tar.gz /test/test.wav ./

@ -1,3 +0,0 @@
*
!Makefile
!src/cpp/

@ -1,13 +0,0 @@
FROM debian:buster
ARG TARGETARCH
ARG TARGETVARIANT
COPY local/en-us/ljspeech/low/en-us-ljspeech-low.onnx \
local/en-us/ljspeech/low/en-us-ljspeech-low.onnx.json ./
ADD dist/linux_${TARGETARCH}${TARGETVARIANT}/piper_${TARGETARCH}${TARGETVARIANT}.tar.gz ./
RUN cd piper/ && echo 'This is a test.' | ./piper -m ../en-us-ljspeech-low.onnx -f test.wav
RUN if [ ! -f piper/test.wav ]; then exit 1; fi
RUN size="$(wc -c < piper/test.wav)"; \
if [ "${size}" -lt "1000" ]; then echo "File size is ${size} bytes"; exit 1; fi

@ -1,3 +0,0 @@
*
!dist/
!local/en-us/ljspeech/low/
Loading…
Cancel
Save