test: Ensure bindata.go is always up to date

This adds three more steps to the Travis tests.
1. Compile Elm -> script.js
2. Bundle html.index & script.js -> bindata.go
3. Check if bindata.go hasn't changed
This commit is contained in:
Max Leonard Inden 2017-04-21 15:52:22 +02:00 committed by stuart nelson
parent d58e81db46
commit a8d7f92c66
3 changed files with 8 additions and 13 deletions

View File

@ -13,4 +13,6 @@ before_install:
script:
- make
- docker run --rm -t -v "$(pwd):/app" -w /app/ui/app elm-env elm-format --validate src/
- docker run --rm -t -v "$(pwd):/app" -w /app/ui/app elm-env elm-make --yes src/Main.elm --output /dev/null
- docker run --rm -t -v "$(pwd):/app" -w /app/ui/app elm-env elm-make --yes src/Main.elm --output script.js
- docker run --rm -t -v "$(pwd):/usr/src/app" -w /usr/src/app golang make assets
- git diff --exit-code

View File

@ -58,9 +58,10 @@ docker:
assets:
@echo ">> writing assets"
-@$(GO) get -u github.com/jteeuwen/go-bindata/...
# Using "-modtime 1" to make assets target deterministic. It sets all file time stamps to unix timestamp 1
@go-bindata $(bindata_flags) -modtime 1 -pkg ui -o ui/bindata.go ui/app/index.html ui/app/script.js
@go-bindata $(bindata_flags) -modtime 1 -pkg deftmpl -o template/internal/deftmpl/bindata.go template/default.tmpl
# Using "-mode 420" and "-modtime 1" to make assets make target deterministic.
# It sets all file permissions and time stamps to 420 and 1
@go-bindata $(bindata_flags) -mode 420 -modtime 1 -pkg ui -o ui/bindata.go ui/app/index.html ui/app/script.js
@go-bindata $(bindata_flags) -mode 420 -modtime 1 -pkg deftmpl -o template/internal/deftmpl/bindata.go template/default.tmpl
promu:
@GOOS=$(shell uname -s | tr A-Z a-z) \

View File

@ -1,11 +1,3 @@
FROM node:latest
ENV ELM_FORMAT_VERSION 0.6.0-alpha
ENV ELM_VERSION 0.18
RUN npm install -g elm@0.18.0
RUN wget https://github.com/avh4/elm-format/releases/download/${ELM_FORMAT_VERSION}/elm-format-${ELM_VERSION}-${ELM_FORMAT_VERSION}-linux-x64.tgz -O "elm-format" && \
tar -xvzf elm-format && \
mv elm-format /usr/local/bin/elm-format && \
chmod +x /usr/local/bin/elm-format
RUN npm install -g elm elm-format