-
Notifications
You must be signed in to change notification settings - Fork 8
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
ci: upload WASM and download in other workflows #147
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,9 +1,11 @@ | ||||||||||||||||||||||||||||||
name: Rust | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
on: | ||||||||||||||||||||||||||||||
push: | ||||||||||||||||||||||||||||||
branches: [ main ] | ||||||||||||||||||||||||||||||
pull_request: | ||||||||||||||||||||||||||||||
workflow_run: | ||||||||||||||||||||||||||||||
workflows: | ||||||||||||||||||||||||||||||
- prophet-wasmstan | ||||||||||||||||||||||||||||||
types: | ||||||||||||||||||||||||||||||
- "completed" | ||||||||||||||||||||||||||||||
Comment on lines
+4
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Sequential workflow dependency is justified but can be optimized The sequential dependency on
Recommend splitting this into two workflows:
This will optimize CI time while maintaining the required dependencies. 🔗 Analysis chainVerify the sequential workflow dependency requirement. The workflow now runs sequentially after
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify the prophet-wasmstan workflow exists and its artifact usage
# Test 1: Check if the prophet-wasmstan workflow exists
echo "Verifying prophet-wasmstan workflow existence:"
fd -p ".github/workflows/*" -x grep -l "name:.*prophet-wasmstan"
# Test 2: Check which jobs/steps use the WASM artifact
echo -e "\nChecking WASM artifact usage in test commands:"
rg "prophet-wasmstan\.wasm" -A 3
Length of output: 313 Script: #!/bin/bash
# Let's try a broader search to understand the workflow dependencies and WASM usage
# Check all workflow files
echo "=== All GitHub Workflow Files ==="
fd -p ".github/workflows/"
# Look for any WASM-related content in workflows
echo -e "\n=== WASM-related content in workflows ==="
rg -i "wasm" .github/workflows/
# Check for artifact download/usage in the rust.yml
echo -e "\n=== Artifact usage in rust.yml ==="
cat .github/workflows/rust.yml
# Look for any prophet-wasmstan references
echo -e "\n=== prophet-wasmstan references ==="
rg -i "prophet-wasmstan" .github/workflows/
Length of output: 3506 |
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||
CARGO_TERM_COLOR: always | ||||||||||||||||||||||||||||||
|
@@ -26,6 +28,10 @@ jobs: | |||||||||||||||||||||||||||||
name: Tests | ||||||||||||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||
- uses: actions/download-artifact@v4 | ||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||
name: prophet-wasmstan.wasm | ||||||||||||||||||||||||||||||
path: crates/augurs-prophet/prophet-wasmstan.wasm | ||||||||||||||||||||||||||||||
Comment on lines
+31
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move artifact download after checkout. The artifact download step is positioned before the repository checkout, which could cause issues:
Apply this change to fix the ordering: - - uses: actions/download-artifact@v4
- with:
- name: prophet-wasmstan.wasm
- path: crates/augurs-prophet/prophet-wasmstan.wasm
- name: Checkout sources
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: moonrepo/setup-rust@v1
+ - name: Download WASM artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: prophet-wasmstan.wasm
+ path: crates/augurs-prophet/prophet-wasmstan.wasm 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||
- name: Checkout sources | ||||||||||||||||||||||||||||||
uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ on: | |
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
@@ -30,3 +29,7 @@ jobs: | |
- uses: actions/setup-node@v4 | ||
- name: Run node test | ||
run: just components/test | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: prophet-wasmstan.wasm | ||
path: components/cpp/prophet-wasmstan.wasm | ||
Comment on lines
+32
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification The artifact path in the workflow needs to be updated The current path path: components/cpp/prophet-wasmstan/prophet-wasmstan-component.wasm
🔗 Analysis chainLGTM! Verify the artifact path exists. The artifact upload step is correctly configured using the latest version of the upload-artifact action. Let's verify the artifact path exists in the repository: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check if the WASM artifact path exists and is generated during the build
# Expected: Find references to the WASM file in build scripts or configuration
# Check for references to the WASM file path in build scripts
rg -l "prophet-wasmstan\.wasm" components/
# Check if there are any build/compilation steps that generate this file
fd -t f "just.*" components/ -x grep -l "prophet-wasmstan\.wasm" {} \;
Length of output: 120 Script: #!/bin/bash
# Let's try a broader search to understand the WASM build setup
# Check for any WASM-related build configurations
rg -l "\.wasm" components/cpp/
# Look for build scripts or configuration files in cpp component
fd -t f "(CMakeLists\.txt|Makefile|\.cmake|build\.rs|\.toml)" components/cpp/
# Check for any justfile in the repository
fd justfile
# Look for workflow files that might reference this artifact
rg -l "prophet-wasmstan" .github/workflows/
Length of output: 333 Script: #!/bin/bash
# Let's check the content of relevant files to understand the build process
# Check the README for WASM build instructions
cat components/cpp/prophet-wasmstan/README.md
# Check the justfiles for WASM build targets
cat components/justfile
cat justfile
# Check other workflows that reference this component
cat .github/workflows/rust.yml
Length of output: 8743 |
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.
Add
conclusion: success
to the workflow trigger.The workflow should only run when the
prophet-wasmstan
workflow succeeds, not when it fails. This is especially important for a release workflow.Apply this diff to ensure releases only happen after successful WASM builds:
workflow_run: workflows: - prophet-wasmstan types: - "completed" + conclusion: success branches: - main
📝 Committable suggestion