-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shader compilation in GitHub Actions #178
+142
−1
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,22 @@ | ||
name: compile shaders | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: seanmiddleditch/gha-setup-ninja@master | ||
|
||
- name: setup SPIRV tools | ||
# consider install-vulkan-sdk instead | ||
uses: humbletim/[email protected] | ||
with: | ||
vulkan-query-version: 1.3.204.0 | ||
vulkan-components: Glslang, SPIRV-Cross | ||
vulkan-use-cache: true | ||
|
||
- name: install DXC | ||
uses: napokue/[email protected] | ||
|
||
- name: run shader compilers | ||
run: ninja | ||
shell: pwsh | ||
working-directory: piet-gpu/shader |
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,27 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
pull_request: | ||
|
||
jobs: | ||
rustfmt: | ||
runs-on: ubuntu-latest | ||
name: cargo fmt | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
components: rustfmt | ||
override: true | ||
|
||
- name: cargo fmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check |
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,37 @@ | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
push-shaders: | ||
runs-on: windows-latest | ||
name: compile shaders and push to main | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# need history to make the merge work | ||
# possibly we can optimize this and set | ||
# allow-unrelated-histories on merge | ||
fetch-depth: 0 | ||
- name: prepare repo for compilation | ||
run: | | ||
git fetch origin main | ||
git switch main | ||
git merge dev -m "merge from dev branch" | ||
git rm -r --ignore-unmatch piet-gpu/shader/gen | ||
mkdir piet-gpu/shader/gen | ||
- uses: ./.github/actions/shader | ||
- name: commit | ||
id: commit | ||
continue-on-error: true | ||
run: | | ||
git add piet-gpu/shader/gen | ||
git config user.name "Commit by GitHub Action" | ||
git config user.email "[email protected]" | ||
git commit -m "commit compiled shaders" | ||
- name: push | ||
if: steps.commit.outcome == 'success' | ||
run: | | ||
git show-ref | ||
git push origin main |
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,13 @@ | ||
on: | ||
pull_request: | ||
branches-ignore: | ||
- main | ||
|
||
jobs: | ||
push-shaders: | ||
runs-on: windows-latest | ||
name: compile shaders | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: mkdir piet-gpu/shader/gen | ||
- uses: ./.github/actions/shader |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
-force
here should suppress the error if the directory already exists. It might be worth not doing this though and just rejecting any PRs that contain the gen directory?