Skip to content

Commit

Permalink
github: Add script and workflow to automatically update stub report
Browse files Browse the repository at this point in the history
On every push to master, we now regenerate the tub eport and check
if it's changed from the one currently published on the website.
If it has, we push a new commit to the website
  • Loading branch information
Aaron1011 committed Feb 2, 2024
1 parent 28dc164 commit 46dc334
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/update_website_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Update AVM2 implementation report on website

on:
push:
branches: [ master ]
# FIXME - remove before merging
pull_request:
branches: [master]

jobs:
crowdin:
runs-on: ubuntu-latest

if: github.repository == 'ruffle-rs/ruffle'

strategy:
max-parallel: 1 # Should be 1 to avoid parallel builds
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run website update script
run: |
./update-website.sh
27 changes: 27 additions & 0 deletions update-website.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -euxo pipefail

rm -rf /tmp/ruffle-website-update
mkdir /tmp/ruffle-website-update

cargo run --package stub-report /tmp/ruffle-website-update/implementation.json

cd /tmp/ruffle-website-update/
git clone https://github.com/ruffle-rs/api-report
cd api-report
cargo run -- -s avm2_specification.json -i ../implementation.json -o ../report.json

cd ../

git clone https://github.com/ruffle-rs/ruffle-rs.github.io
cd ruffle-rs.github.io

if cmp -s "../report.json" "src/app/compatibility/avm2/report.json"; then
echo "Report is unchanged, exiting"
exit 0
fi

echo "Report is changed - pushing commit"
cp ../report.json src/app/compatibility/avm2/report.json
git add src/app/compatibility/avm2/report.json
git commit -m "Update AVM2 report from https://github.com/ruffle-rs/ruffle/commit/${GITHUB_SHA}"

0 comments on commit 46dc334

Please sign in to comment.