Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Add Github Actions to update schema #462

Merged
merged 4 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ src/__Private/CodegenCLI.hack export-ignore
src/codegen/data/ export-ignore
tests/ export-ignore
codegen/**/* linguist-generated
codegen-no-rebuild/**/* linguist-generated
.hhconfig export-ignore
.hhvmconfig.hdf export-ignore
*.hack linguist-language=Hack
Expand Down
62 changes: 59 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,31 @@ on:
push:
pull_request:
schedule:
- cron: '42 15 * * *'
- cron: "42 15 * * *"
jobs:
determine-latest-breaking-hhvm-version:
runs-on: ubuntu-latest
outputs:
latest-breaking-hhvm-version: ${{steps.determine-latest-breaking-hhvm-version.outputs.latest-breaking-hhvm-version}}
steps:
- uses: actions/checkout@v3
- id: determine-latest-breaking-hhvm-version
run: |
[[ \
"$(<codegen-no-rebuild/latest_breaking_version.hack)" \
=~ const\ string\ LATEST_BREAKING_HHVM_VERSION\ =\ \'([0-9]+\.[0-9]+)\. \
]] && \
echo "::set-output name=latest-breaking-hhvm-version::${BASH_REMATCH[1]}"
build:
needs: determine-latest-breaking-hhvm-version
name: HHVM ${{matrix.hhvm}} - ${{matrix.os}}
strategy:
# Run tests on all OS's and HHVM versions, even if one fails
fail-fast: false
matrix:
os: [ ubuntu , macos ]
os: [ubuntu, macos]
hhvm:
- '4.158'
- ${{needs.determine-latest-breaking-hhvm-version.outputs.latest-breaking-hhvm-version}}
- latest
- nightly
runs-on: ${{matrix.os}}-latest
Expand All @@ -28,3 +42,45 @@ jobs:
run: bin/hhast-lint
- name: Check for manually modified codegen
run: vendor/bin/hh-codegen-verify-signatures codegen/
update-schema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: hhvm/actions/hack-lint-test@master
with:
hhvm: nightly
skip_lint: true
skip_tests: true
- if: github.event_name == 'pull_request'
run: bin/update-codegen
- if: github.event_name == 'pull_request'
uses: reviewdog/action-suggester@v1
with:
tool_name: Update schema
- if: github.event_name != 'pull_request'
uses: actions/checkout@v3
with:
submodules: true
repository: facebook/hhvm
path: ./.var/tmp/hhvm
- if: github.event_name != 'pull_request'
run: bin/update-schema --hhvm-path=./.var/tmp/hhvm
- if: github.event_name != 'pull_request'
uses: peter-evans/create-pull-request@v4
with:
branch: update-schema/${{github.ref_name}}
title: Update schema
commit-message: Update schema
- if: github.event_name != 'pull_request'
run: git checkout -B "${{github.ref_name}}"
- if: github.event_name != 'pull_request'
run: bin/update-codegen --dont-update-ast --update-latest-breaking-version
- if: github.event_name != 'pull_request'
uses: peter-evans/create-pull-request@v4
with:
branch: update-latest-breaking-version/${{github.ref_name}}
title: Update schema to a backward incompatible version
commit-message: Update the latest breaking version
body: |
This PR updates assumes the latest schema is a breaking change.
Feel free to close this PR if the schema is actually backward compatible with previous schema versions.
12 changes: 12 additions & 0 deletions codegen-no-rebuild/latest_breaking_version.hack

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions codegen/inferred_relationships.hack

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion codegen/node_from_json.hack

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 38 additions & 3 deletions codegen/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading