-
Notifications
You must be signed in to change notification settings - Fork 24
Cleanup CI #147
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
Merged
Merged
Cleanup CI #147
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b7a15ee
Build Dependencies workflow failed
Devon7925 5a8a9d2
Try reusing build logic
Devon7925 37ab4fb
Copy required wasm files for smoke test
Devon7925 23c94b3
Remove unneccessary cleanup in ci
Devon7925 387a1d4
Merge branch 'main' into Devon7925/issue146
Devon7925 20ac1b7
Simplify cloning for merge
Devon7925 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 hidden or 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,98 @@ | ||
# Composite action to build and cache WASM dependencies (slang, spirv-tools) | ||
name: 'Build WASM Deps' | ||
description: 'Build and cache WASM dependencies (slang, spirv-tools) for the project.' | ||
inputs: | ||
build-artifacts-dir: | ||
description: 'Directory to move built artifacts into.' | ||
required: true | ||
default: ./src | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Setup emsdk | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y ninja-build | ||
if [ ! -d "emsdk" ]; then | ||
git clone https://github.com/emscripten-core/emsdk.git | ||
sed -i 's/\r$//' emsdk/emsdk emsdk/emsdk_env.sh | ||
fi | ||
|
||
- name: get slang head commit | ||
shell: bash | ||
run: | | ||
if [ ! -d "slang-repo" ]; then | ||
git clone https://github.com/shader-slang/slang.git slang-repo | ||
fi | ||
git -C slang-repo rev-parse HEAD > key.txt | ||
|
||
- name: get spirv-tool head commit | ||
shell: bash | ||
run: | | ||
if [ ! -d "spirv-tools" ]; then | ||
git clone https://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools | ||
pushd spirv-tools | ||
git checkout vulkan-sdk-1.3.290.0 | ||
popd | ||
fi | ||
git -C spirv-tools rev-parse HEAD > key-spirv-tool.txt | ||
|
||
- name: restore slang-wasm | ||
id: cache_slang | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
./slang-wasm.wasm.gz | ||
./slang-wasm.js | ||
./slang-wasm.d.ts | ||
key: ${{ hashFiles('key.txt') }} | ||
|
||
- name: restore spirv-tools | ||
id: cache_spirv_tools | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
./spirv-tools.wasm | ||
./spirv-tools.js | ||
./spirv-tools.d.ts | ||
key: ${{ hashFiles('key-spirv-tool.txt') }} | ||
|
||
- name: slang-wasm build | ||
if: steps.cache_slang.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
/bin/bash -x ./build_scripts/slang-wasm-build.sh | ||
|
||
- name: save slang-wasm | ||
if: steps.cache_slang.outputs.cache-hit != 'true' | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
./slang-wasm.wasm.gz | ||
./slang-wasm.js | ||
./slang-wasm.d.ts | ||
key: ${{ hashFiles('key.txt') }} | ||
|
||
- name: spirv-tools-wasm build | ||
if: steps.cache_spirv_tools.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
/bin/bash -x ./build_scripts/spirv-tool-wasm-build.sh | ||
|
||
- name: save spirv-tools-wasm | ||
if: steps.cache_spirv_tools.outputs.cache-hit != 'true' | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
./spirv-tools.wasm | ||
./spirv-tools.js | ||
./spirv-tools.d.ts | ||
key: ${{ hashFiles('key-spirv-tool.txt') }} | ||
|
||
- name: Move artifacts | ||
shell: bash | ||
run: | | ||
mkdir -p ${{ inputs.build-artifacts-dir }} | ||
mv ./slang-wasm.wasm.gz ./slang-wasm.js ./slang-wasm.d.ts ${{ inputs.build-artifacts-dir }}/ | ||
mv ./spirv-tools.wasm ./spirv-tools.js ./spirv-tools.d.ts ${{ inputs.build-artifacts-dir }}/ |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 @@ | ||
*.sh text eol=lf |
This file contains hidden or 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
0
spirv-tool-wasm-build.sh → build_scripts/spirv-tool-wasm-build.sh
100755 → 100644
File renamed without changes.
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.
I'm trying to understand what exactly this workflow is doing.
Is this workflow only ran when user manually trigger it? If that is the case, do we really need to
Upload export artifact
step? Are any other jobs using the artifacts? Or it's just for people to download the artifacts?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.
The workflow is designed so that people can get development dependencies without building them on their local computer. I put this as the recommended way to do it due to me having many problems trying to locally build the dependencies when I was starting development. It is only run when users trigger it, and the uploaded artifacts are only for them.