test: Add elm-format + elm-make job to ci

This runs elm-format and elm-make inside a docker container which servs
the Elm environment.

Related to issue #671
This commit is contained in:
Max Leonard Inden 2017-04-04 14:16:06 +02:00 committed by Max Inden
parent eeee29c65b
commit f50a9ef9db
4 changed files with 30 additions and 6 deletions

View File

@ -1,8 +1,16 @@
sudo: false
language: go
services:
- docker
go:
- 1.7.3
before_install:
- docker build -t elm-env ui/.
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

11
ui/Dockerfile Normal file
View File

@ -0,0 +1,11 @@
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

View File

@ -37,10 +37,9 @@ silence =
|: (field "createdBy" Json.string)
-- Remove this maybe once the api either disallows empty comments on
-- creation, or returns an empty string.
|:
((Json.maybe (field "comment" Json.string))
|: ((Json.maybe (field "comment" Json.string))
|> Json.andThen (\x -> Json.succeed <| Maybe.withDefault "" x)
)
)
|: (field "startsAt" iso8601Time)
|: (field "endsAt" iso8601Time)
|: (field "updatedAt" iso8601Time)

View File

@ -33,9 +33,15 @@ toSilence { createdBy, comment, startsAt, endsAt, matchers } =
, createdBy = createdBy
, startsAt = parsedStartsAt
, endsAt = parsedEndsAt
, silencedAlertGroups = Success [] {- ignored -}
, updatedAt = 0 {- ignored -}
, id = "" {- ignored -}
{- ignored -}
, silencedAlertGroups = Success []
{- ignored -}
, updatedAt = 0
{- ignored -}
, id = ""
}
)
(timeFromString startsAt)