Move test into main Docker build

This commit is contained in:
Michael Hansen
2023-06-08 14:21:10 -05:00
parent 99f0936789
commit 8b3dfc20dd
5 changed files with 24 additions and 20 deletions
+5
View File
@@ -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
+19 -1
View File
@@ -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 ./
-3
View File
@@ -1,3 +0,0 @@
*
!Makefile
!src/cpp/
-13
View File
@@ -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
-3
View File
@@ -1,3 +0,0 @@
*
!dist/
!local/en-us/ljspeech/low/