Check haddock documentation on CI servers (#87)

Former-commit-id: ef2c7ff021548df5bb3b07986e788c51487905d6
This commit is contained in:
David Himmelstrup 2020-06-09 19:25:27 +08:00 committed by GitHub
commit 364b8149fd
5 changed files with 34 additions and 93 deletions

View file

@ -26,7 +26,7 @@ jobs:
steps:
- task: Cache@2
inputs:
key: ${{ parameters.name }} | ${{ parameters.vmImage }} | $(STACK_YAML) | stack-root | $(Agent.OS) | version4
key: ${{ parameters.name }} | ${{ parameters.vmImage }} | $(STACK_YAML) | stack-root | $(Agent.OS)
path: $(STACK_ROOT)
cacheHitVar: CACHE_RESTORED
displayName: Cache stack root
@ -39,77 +39,17 @@ jobs:
#sudo apt-get install povray
mkdir -p ~/.local/bin
curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
case "$BUILD" in
style)
PACKAGE=hlint
echo "Downloading $PACKAGE now ..."
RELEASES=$(curl --silent https://github.com/ndmitchell/$PACKAGE/releases)
URL=https://github.com/$(echo "$RELEASES" | grep -o '\"[^\"]*-x86_64-linux\.tar\.gz\"' | sed s/\"//g | head -n1)
VERSION=$(echo "$URL" | sed -e 's/.*-\([\.0-9]\+\)-x86_64-linux\.tar\.gz/\1/')
curl --progress-bar --location -o"$PACKAGE.tar.gz" "$URL"
tar -xzf "$PACKAGE.tar.gz" -C .
mv "$PACKAGE-$VERSION" "$PACKAGE"
export PATH="$(pwd)"/hlint:$PATH
;;
cabal)
sudo add-apt-repository -y ppa:hvr/ghc
sudo apt-get update
sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
# See note here: https://github.com/haskell-CI/haskell-ci#alex--happy-with-ghc--78
if [ "$GHCVER" = "head" ] || [ "${GHCVER%.*}" = "7.8" ] || [ "${GHCVER%.*}" = "7.10" ]; then
sudo apt-get install happy-1.19.4 alex-3.1.3
export PATH=/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:$PATH
else
sudo apt-get install happy alex
fi
export PATH=$HOME/.local/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
cabal --version
cabal update
PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
;;
*)
export PATH=$HOME/.local/bin:$PATH
stack --install-ghc test $ARGS --flag reanimate:test --only-dependencies
;;
esac
set -ex
case "$BUILD" in
style)
hlint src/
;;
cabal)
cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
ORIGDIR=$(pwd)
for dir in $PACKAGES
do
cd $dir
cabal check || [ "$CABALVER" == "1.16" ]
cabal sdist
PKGVER=$(cabal info . | awk '{print $2;exit}')
SRC_TGZ=$PKGVER.tar.gz
cd dist
tar zxfv "$SRC_TGZ"
cd "$PKGVER"
cabal configure --enable-tests --ghc-options -O0
cabal build
if [ "$CABALVER" = "1.16" ] || [ "$CABALVER" = "1.18" ]; then
cabal test
else
cabal test --show-details=streaming
fi
cd $ORIGDIR
done
;;
*)
stack ./examples/counter.hs check
stack test --flag reanimate:test --test-arguments="-j2"
;;
esac
set +ex
env:
OS_NAME: ${{ parameters.os }}
displayName: 'Installation ${{parameters.os}} & Test'
export PATH=$HOME/.local/bin:$PATH
displayName: 'Setup'
- script: |
stack --install-ghc build --haddock $ARGS --only-dependencies
stack --install-ghc build --test $ARGS --flag reanimate:test --only-dependencies
displayName: 'Install dependencies'
- script: |
# stack ./examples/counter.hs check
stack test --flag reanimate:test --test-arguments="-j2"
displayName: 'Build & Test'
- script: |
stack haddock
displayName: 'Build documentation'

View file

@ -3,7 +3,6 @@
## 0.4.0.0
* Show progress when running ffmpeg.
* Add GHC-8.4.4 build test to CI.
* Small improvements to the scene API.
* Bug fixes to the voice API.

View file

@ -114,7 +114,7 @@ library
JuicyPixels >= 3.3.3, attoparsec, parallel,
cubicbezier, websockets >= 0.12.7.0,
hashable, fsnotify, open-browser, random, random-shuffle, base64-bytestring,
vector >= 0.12.0.0, colour, cassava, ansi-wl-pprint, here, temporary,
vector >= 0.12.0.0, colour, cassava, ansi-wl-pprint, th-printf >= 0.6, temporary,
optparse-applicative, chiphunk >= 0.1.2.1,
geojson, aeson >= 1.3.0.0,
split, fingertree, array, cereal, vector-space
@ -147,4 +147,5 @@ test-suite spec
QuickCheck >= 2.1.0, text,
tasty, tasty-golden, tasty-hunit,
tasty-quickcheck,
ansi-wl-pprint
ansi-wl-pprint,
here

View file

@ -18,7 +18,7 @@ import Reanimate.Ease
import Reanimate.Transition
import Reanimate.Svg.Constructors
import Data.String.Here
import Language.Haskell.Printf (s)
import qualified Data.Text as T
data FlipSprite s = FlipSprite
@ -33,21 +33,21 @@ flipSprite front back = do
bend <- newVar 0
trans <- newVar 0
rotX <- newVar 0
s <- newSprite $ do
sprite <- newSprite $ do
getBend <- unVar bend
getTrans <- unVar trans
getRotX <- unVar rotX
t <- spriteT
time <- spriteT
dur <- spriteDuration
return $
let rotY = fromToS 0 pi (t/dur)
frontTexture = svgAsPngFile (frameAt t $ setDuration dur front)
backTexture = svgAsPngFile (flipXAxis $ frameAt t $ setDuration dur back)
let rotY = fromToS 0 pi (time/dur)
frontTexture = svgAsPngFile (frameAt time $ setDuration dur front)
backTexture = svgAsPngFile (flipXAxis $ frameAt time $ setDuration dur back)
-- seq'ing frontTexture and backTexture is required to avoid segfaults. :(
in frontTexture `seq` backTexture `seq`
blender (script frontTexture backTexture getBend getTrans getRotX rotY)
return FlipSprite
{ fsSprite = s
{ fsSprite = sprite
, fsBend = bend
, fsZoom = trans
, fsWobble = rotX }
@ -69,7 +69,7 @@ flipTransition = flipTransitionOpts bend zoom wobble
wobble = -pi*0.10
script :: FilePath -> FilePath -> Double -> Double -> Double -> Double -> T.Text
script frontImage backImage bend transZ rotX rotY = [iTrim|
script frontImage backImage bend transZ rotX rotY = T.pack $ [s|
import os
import math
@ -82,7 +82,7 @@ bpy.ops.object.delete()
cam = bpy.data.objects['Camera']
cam.location = (0,0,22.22 + ${transZ})
cam.location = (0,0,22.22 + %f)
cam.rotation_euler = (0, 0, 0)
bpy.ops.object.empty_add(location=(0.0, 0, 0))
focus_target = bpy.context.object
@ -91,7 +91,7 @@ cam.select_set(True)
focus_target.select_set(True)
bpy.ops.object.parent_set()
focus_target.rotation_euler = (${rotX}, 0, 0)
focus_target.rotation_euler = (%f, 0, 0)
origin = bpy.data.objects['Cube']
@ -99,10 +99,10 @@ bpy.ops.object.select_all(action='DESELECT')
origin.select_set(True)
bpy.ops.object.delete()
x = ${bend}
x = %f
bpy.ops.mesh.primitive_plane_add()
plane = bpy.context.object
plane.scale = (16/2,${fromToS (9/2) 4 bend},1)
plane.scale = (16/2,%f,1)
bpy.ops.object.shade_smooth()
bpy.context.object.active_material = bpy.data.materials['Material']
@ -129,10 +129,10 @@ mat.node_tree.links.new(gh_node.outputs['Alpha'], gh_mix.inputs['Fac'])
mat.node_tree.links.new(transparent.outputs['BSDF'], gh_mix.inputs[1])
mat.node_tree.links.new(gh_mix.outputs['Shader'], mix.inputs[2])
image_node.image = bpy.data.images.load('${T.pack frontImage}')
image_node.image = bpy.data.images.load('%s')
image_node.interpolation = 'Closest'
gh_node.image = bpy.data.images.load('${T.pack backImage}')
gh_node.image = bpy.data.images.load('%s')
gh_node.interpolation = 'Closest'
@ -166,7 +166,7 @@ plane.select_set(True);
bpy.ops.object.origin_clear()
bpy.ops.object.origin_set(type='GEOMETRY_ORIGIN')
plane.rotation_euler = (0, ${rotY}, 0)
plane.rotation_euler = (0, %f, 0)
scn = bpy.context.scene
@ -182,4 +182,4 @@ scn.render.resolution_y = 1440
scn.render.film_transparent = True
bpy.ops.render.render( write_still=True )
|]
|] transZ rotX bend (fromToS (9/2) 4 bend) frontImage backImage rotY

View file

@ -16,3 +16,4 @@ extra-deps:
- websockets-0.12.7.1@sha256:4363a5ca794af094971266a1397807ac55d5b3124645060fb78c64ac4c88a1f1,7863
- clock-0.8@sha256:b4ae207e2d3761450060a0d0feb873269233898039c76fceef9cc1a544067767,4113
- JuicyPixels-3.3.5@sha256:5c67dc066d67f5045221a8202f701f4c77eab8220f44414c00fadcdc3e4f872b,3911
- th-printf-0.7@sha256:c6b2c08e62a32a327b29b1a3739939f0c85b4079ff2ae6d79fac639f25ee48b1,2297