Browse Source

Compare GIFs in CI with ImageMagick

add-vhs-ci
Kevin Ness 7 months ago
parent
commit
68c59ea70a
  1. 37
      .github/tapes/boa_cli.tape
  2. 37
      .github/tapes/boa_cli_src.tape
  3. 4
      .github/tapes/ci_cli_intro.tape
  4. 19
      .github/workflows/artifacts.yml

37
.github/tapes/boa_cli.tape

@ -1,37 +1,4 @@
Output cli/assets/boa_cli.gif Output cli/assets/boa_cli.gif
# Setup env # The below path assumes that we are calling from Boa's root.
Hide Source ./.github/tapes/boa_cli_src.tape
Set TypingSpeed 50ms
Set Theme "GruvboxDark"
Set Shell fish
# boa_cli needs to be installed for the tape to run.
Require boa
Show
Type "boa"
Sleep 100ms
Enter
Type "2 + '2'"
Enter
Sleep 100ms
Type "const sayHello = () => { return 'Hello World!' };"
Enter
Sleep 100ms
Type "sayHello();"
Enter
Sleep 2s

37
.github/tapes/boa_cli_src.tape

@ -0,0 +1,37 @@
# The source tape file for creating the CLI intro GIF
# Setup env
Hide
Set TypingSpeed 50ms
Set Theme "GruvboxDark"
Set Shell fish
# boa_cli needs to be installed for the tape to run.
Require boa
Show
Type "boa"
Sleep 100ms
Enter
Type "2 + '2'"
Enter
Sleep 100ms
Type "const sayHello = () => { return 'Hello World!' };"
Enter
Sleep 100ms
Type "sayHello();"
Enter
Sleep 2s

4
.github/tapes/ci_cli_intro.tape

@ -0,0 +1,4 @@
Output tmp/boa_cli.gif
# The below path assumes that we are calling from Boa's root.
Source ./.github/tapes/boa_cli_src.tape

19
.github/workflows/artifacts.yml

@ -1,7 +1,7 @@
name: Build Artifacts name: Build Artifacts
on: on:
push: pull_request:
branches: branches:
- main - main
@ -18,14 +18,11 @@ jobs:
# https://github.com/charmbracelet/vhs-action/blob/main/examples/auto-commit.yml # https://github.com/charmbracelet/vhs-action/blob/main/examples/auto-commit.yml
- uses: charmbracelet/vhs-action@v1 - uses: charmbracelet/vhs-action@v1
with: with:
path: './.github/tapes/boa_cli.tape' version: v0.7.1
- uses: stefanzweifel/git-auto-commit-action@v4 path: './.github/tapes/ci_cli_intro.tape'
env: - uses: mfinelli/setup-imagemagick@v5
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
commit_message: Update generated VHS GIF cache: true
branch: main - run: magick compare -verbose ./tmp/boa_cli.gif ./cli/assets/boa_cli.gif
commit_user_name: vhs-action 📼 # Clean up tmp directory created by ci_cli_intro.tape
commit_user_email: actions@github.com - run: rm -rf ./tmp
commit_author: vhs-action 📼 <actions@github.com>
file_pattern: '*.gif'

Loading…
Cancel
Save