-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 4.3 project update... apparently opening the project did this ¯\_(ツ)_/¯ * add workflow to diff generated output * generate to /tmp * Example generator change. * generate to .build * don't sandbox * try just using build products * don't sparse checkout since we need to switch branches * cleaner output * tweaked diff * filter for changes in the generator * use the right name for the workflow!
- Loading branch information
Showing
3 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# This workflow checks to see if the Generator code has changed. | ||
# If it has, we run the new generator, and the version from the target branch, | ||
# and then we diff the two outputs. | ||
|
||
name: Generator | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-diff | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# JOB to run change detection | ||
changes: | ||
runs-on: ubuntu-latest | ||
# Required permissions | ||
permissions: | ||
pull-requests: read | ||
# Set job outputs to values from filter step | ||
outputs: | ||
generator: ${{ steps.filter.outputs.generator }} | ||
steps: | ||
# For pull requests it's not necessary to checkout the code | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
generator: | ||
- 'Generator/**' | ||
# JOB to run the diff - only runs if changes were detected in Generator/ | ||
diff-generator: | ||
needs: changes | ||
if: ${{ needs.changes.outputs.generator == 'true' }} | ||
runs-on: macos-14 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
generator: | ||
- 'Generator/**' | ||
- name: Set up Xcode | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: "16.2" | ||
- name: Build This Branch | ||
run: swift build --target SwiftGodot --scratch-path .build/New | ||
- name: Checkout Target Branch | ||
run: git checkout ${{ github.event.pull_request.base.sha }} | ||
- name: Build Target Branch | ||
run: swift build --target SwiftGodot --scratch-path .build/Old | ||
- name: Diff generated | ||
run: diff --recursive --color=auto --minimal .build/New/plugins/outputs/swiftgodot/SwiftGodot/destination/CodeGeneratorPlugin/ .build/Old/plugins/outputs/swiftgodot/SwiftGodot/destination/CodeGeneratorPlugin/ | sed -e 's/diff\(.*\)\/\(.*\).swift/\n\2.swift:/' | ||
|
||
|
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
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