fix: update runtime compat data (#172) #892
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Update Runtime Data" | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 12 * * *" | |
workflow_dispatch: | |
pull_request: | |
permissions: | |
pull-requests: write | |
contents: write | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: corepack enable | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: "pnpm" | |
- uses: wasmerio/setup-wasmer@v3.1 | |
- run: wasmer run wasmer/winterjs -- -V | |
- uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: vx.x.x | |
- name: Download Fastly CLI | |
uses: robinraju/release-downloader@v1.11 | |
with: | |
repository: fastly/cli | |
latest: true | |
fileName: fastly_*_linux_amd64.deb | |
- name: Install Fastly CLI | |
run: sudo dpkg -i fastly_*_linux_amd64.deb && fastly version | |
- name: Download LLRT | |
uses: robinraju/release-downloader@v1.11 | |
with: | |
repository: awslabs/llrt | |
latest: true | |
fileName: llrt-linux-x64.zip | |
out-file-path: downloads | |
# Manually unzip because this seems to corrupt the binary | |
extract: false | |
- name: Setup LLRT | |
run: | | |
export DOWNLOADS="$GITHUB_WORKSPACE/downloads" | |
unzip $DOWNLOADS/llrt-linux-x64.zip -d $DOWNLOADS | |
sudo chmod +x $DOWNLOADS/* | |
echo "$DOWNLOADS" >> $GITHUB_PATH | |
- run: pnpm install | |
- name: Get browser tests | |
uses: actions/checkout@v4 | |
with: | |
repository: openwebdocs/mdn-bcd-collector | |
path: .bcd | |
fetch-depth: 0 | |
- name: Switch to latest mdn-bcd-collector release | |
run: | | |
latestTag=$(git describe --tags "$(git rev-list --tags --max-count=1)") | |
git checkout $latestTag | |
working-directory: .bcd | |
- name: Prepare mdn-bcd-collector environment | |
run: npm install --ignore-scripts | |
working-directory: .bcd | |
- name: Generate runtime tests | |
run: npm run build | |
env: | |
NODE_ENV: production | |
working-directory: .bcd | |
- name: Generate compat data | |
timeout-minutes: 10 | |
run: | | |
cp .bcd/tests.json vendor/tests.json | |
# Make diffs easier to read | |
pnpm prettier vendor/tests.json -w | |
pnpm generate | |
rm -rf .bcd | |
pnpm test | |
env: | |
WAIT_ON_TIMEOUT: 30000 | |
- name: Get runtime versions | |
id: get-versions | |
run: node --no-warnings=ExperimentalWarning scripts/version.mjs >> "$GITHUB_OUTPUT" | |
- name: Create Pull Request | |
# only run when on main branch | |
if: github.ref == 'refs/heads/main' | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
add-paths: | | |
generator/runtimes/*/data.json | |
packages/runtime-compat-data/data.json | |
vendor/tests.json | |
title: "fix: update runtime compat data" | |
commit-message: "fix: update runtime compat data" | |
body: | | |
Updates the runtime compat data. | |
Runtime versions: | |
${{ steps.get-versions.outputs.versions }} | |
base: main |