Skip to content

Add typos, clippy, and fmt #76

Add typos, clippy, and fmt

Add typos, clippy, and fmt #76

Workflow file for this run

name: examples
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- run: rustup update stable
- run: rustup default stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: 'examples'
- uses: FedericoCarboni/setup-ffmpeg@v3
- uses: taiki-e/install-action@v2
with:
tool: typst-cli
- run: sudo apt-get install -y imagemagick
- run: cargo install --path .
- run: |
echo "DEEPINFRA_KEY=${{ secrets.DEEPINFRA_KEY }}" > keys.env
echo "GOOGLE_KEY=${{ secrets.GOOGLE_KEY }}" >> keys.env
- run: |
mkdir _public
echo "<html><body><h1>Home page for the examples</h1></body></html>" > _public/index.html
- name: Run examples
run: |
convert -size 500x500 xc:none -fill white -draw "polygon 150,100 150,400 400,250" play_button.png
./examples/demo.sh
mv _out/out.mp4 _public/demo.mp4
convert _out/image/1.png play_button.png -gravity center -composite tmp.png
mv tmp.png _public/demo.png
./examples/google.sh
mv _out/out.mp4 _public/google.mp4
convert _out/image/1.png play_button.png -gravity center -composite tmp.png
mv tmp.png _public/google.png
./examples/first.sh
mv _out/out.mp4 _public/first.mp4
convert _out/image/1.png play_button.png -gravity center -composite tmp.png
mv tmp.png _public/first.png
- name: Cleanup
run: rm keys.env
- name: Upload static files
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: _public/
deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build
timeout-minutes: 15
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- uses: actions/deploy-pages@v4
id: deployment