mirror of
https://github.com/reanimate/reanimate.git
synced 2026-09-09 07:03:11 +00:00
CI: Check for 404s (#170)
This commit is contained in:
parent
08cffe6099
commit
0ea03ecb23
2 changed files with 73 additions and 5 deletions
19
.github/workflows/site-checks.yml
vendored
19
.github/workflows/site-checks.yml
vendored
|
|
@ -4,7 +4,7 @@ on:
|
|||
schedule:
|
||||
- cron: "0 * * * *"
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ master, feature-ci ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
@ -12,18 +12,27 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js 10.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 10.x
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install w3c-linkchecker
|
||||
- name: Check websocket connection
|
||||
run: |
|
||||
#sudo npm install -g wscat
|
||||
wscat --version
|
||||
wscat --connect --help "wss://reanimate.clozecards.com:443/ws/"
|
||||
set -o xtrace
|
||||
sudo npm i -g wscat
|
||||
wscat --execute "GET /\n" --connect "https://reanimate.clozecards.com/ws/" || echo "Connection failed."
|
||||
- name: Check links at reanimate.github.io
|
||||
run: checklink --quiet --broken "https://reanimate.github.io/" >> failures.txt
|
||||
- name: Check links at reanimate.readthedocs.io
|
||||
run: checklink --quiet --broken "https://reanimate.readthedocs.io/" >> failures.txt
|
||||
- name: Check links in haddock docs
|
||||
run: checklink --quiet --broken "https://hackage.haskell.org/package/reanimate/docs/Reanimate.html" >> failures.txt
|
||||
- name: Check for failures
|
||||
run: |
|
||||
checklink --quiet --broken "https://reanimate.github.io/" > failures.txt
|
||||
if [ -s failures.txt ]; then
|
||||
cat failures.txt
|
||||
exit 1
|
||||
|
|
|
|||
59
reanimate-examples/tut_glue_physics.hs
Executable file
59
reanimate-examples/tut_glue_physics.hs
Executable file
|
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/env stack
|
||||
-- stack runghc --package reanimate
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE RecordWildCards #-}
|
||||
module Main (main) where
|
||||
|
||||
import Chiphunk.Low
|
||||
import Codec.Picture (PixelRGBA8 (..))
|
||||
import Control.Lens
|
||||
import Control.Monad (forM_)
|
||||
import Linear.V2 (V2 (..))
|
||||
import Reanimate
|
||||
import Reanimate.Chiphunk
|
||||
import Reanimate.PolyShape
|
||||
import System.IO.Unsafe (unsafePerformIO)
|
||||
|
||||
shatter :: Animation
|
||||
shatter = unsafePerformIO $ do
|
||||
bodyStore <- newBodyStore
|
||||
let gravity = Vect 0 (-1) -- Gravity points down (negative 1 y/s^2)
|
||||
|
||||
space <- spaceNew
|
||||
spaceGravity space $= gravity
|
||||
|
||||
static <- get $ spaceStaticBody space
|
||||
ground <- segmentShapeNew static
|
||||
(Vect (-screenWidth/2) (-screenHeight/2))
|
||||
(Vect (screenWidth/2) (-screenHeight/2)) 0
|
||||
shapeFriction ground $= 1
|
||||
spaceAddShape space ground
|
||||
|
||||
let toVect (V2 x y) = Vect x y
|
||||
vectGroup = plDecompose $ svgToPolyShapes $ center $ scale 4 $
|
||||
latex "$F=ma$"
|
||||
|
||||
forM_ vectGroup $ \polygon -> do
|
||||
bd <- polygonsToBody space [map toVect polygon]
|
||||
bodyPosition bd $= Vect 0 (screenHeight/3)
|
||||
addToBodyStore bodyStore bd $
|
||||
renderPolyShape $ plFromPolygon polygon
|
||||
|
||||
ani <- simulate space bodyStore fps stepsPerFrame shatterT
|
||||
spaceFreeRecursive space
|
||||
return $ mapA pp ani
|
||||
where
|
||||
shatterT = 10
|
||||
fps = 60
|
||||
stepsPerFrame = 10
|
||||
pp = withStrokeWidth 0.01 . withStrokeColor "black" . withFillColor "black"
|
||||
|
||||
main :: IO ()
|
||||
main = reanimate $ parA bg $ sceneAnimation $ do
|
||||
play $ shatter
|
||||
play $ shatter
|
||||
& reverseA
|
||||
& setDuration 5
|
||||
& signalA (powerS 2)
|
||||
where
|
||||
bg = animate $ const $ mkBackgroundPixel (PixelRGBA8 252 252 252 0xFF)
|
||||
Loading…
Reference in a new issue