-
Notifications
You must be signed in to change notification settings - Fork 666
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
frame-omni-bencher short checks #5268
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0b5b7e1
frameomnibencher short (#34)
mordamax 0b45400
Merge branch 'master' into mak-gha-omnibench
mordamax b53bea2
Merge branch 'master' into mak-gha-omnibench
mordamax dc43223
Update .github/workflows/check-frame-omni-bencher.yml
mordamax af623ef
Merge branch 'master' into mak-gha-omnibench
mordamax 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 was deleted.
Oops, something went wrong.
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,85 @@ | ||
name: Short benchmarks (frame-omni-bencher) | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [ opened, synchronize, reopened, ready_for_review, labeled ] | ||
merge_group: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
ARTIFACTS_NAME: frame-omni-bencher-artifacts | ||
|
||
jobs: | ||
changes: | ||
# TODO: remove once migration is complete or this workflow is fully stable | ||
if: contains(github.event.label.name, 'GHA-migration') | ||
permissions: | ||
pull-requests: read | ||
uses: ./.github/workflows/reusable-check-changed-files.yml | ||
|
||
set-image: | ||
# GitHub Actions allows using 'env' in a container context. | ||
# However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322 | ||
# This workaround sets the container image for each job using 'set-image' job output. | ||
runs-on: ubuntu-latest | ||
needs: changes | ||
if: ${{ needs.changes.outputs.rust }} | ||
outputs: | ||
IMAGE: ${{ steps.set_image.outputs.IMAGE }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- id: set_image | ||
run: cat .github/env >> $GITHUB_OUTPUT | ||
|
||
run-frame-omni-bencher: | ||
runs-on: arc-runners-polkadot-sdk-beefy | ||
needs: [ set-image, changes ] # , build-frame-omni-bencher ] | ||
if: ${{ needs.changes.outputs.rust }} | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false # keep running other workflows even if one fails, to see the logs of all possible failures | ||
matrix: | ||
runtime: | ||
[ | ||
westend-runtime, | ||
rococo-runtime, | ||
asset-hub-rococo-runtime, | ||
asset-hub-westend-runtime, | ||
bridge-hub-rococo-runtime, | ||
bridge-hub-westend-runtime, | ||
collectives-westend-runtime, | ||
coretime-rococo-runtime, | ||
coretime-westend-runtime, | ||
people-rococo-runtime, | ||
people-westend-runtime, | ||
glutton-westend-runtime, | ||
] | ||
container: | ||
image: ${{ needs.set-image.outputs.IMAGE }} | ||
env: | ||
PACKAGE_NAME: ${{ matrix.runtime }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: script | ||
run: | | ||
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm | ||
RUNTIME_BLOB_PATH=./target/release/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME | ||
forklift cargo build --release --locked -p $PACKAGE_NAME -p frame-omni-bencher --features runtime-benchmarks | ||
echo "Running short benchmarking for PACKAGE_NAME=$PACKAGE_NAME and RUNTIME_BLOB_PATH=$RUNTIME_BLOB_PATH" | ||
ls -lrt $RUNTIME_BLOB_PATH | ||
./target/release/frame-omni-bencher v1 benchmark pallet --runtime $RUNTIME_BLOB_PATH --all --steps 2 --repeat 1 | ||
confirm-frame-omni-benchers-passed: | ||
runs-on: ubuntu-latest | ||
name: All benchmarks passed | ||
needs: run-frame-omni-bencher | ||
steps: | ||
- run: echo '### Good job! All the benchmarks passed 🚀' >> $GITHUB_STEP_SUMMARY |
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,59 @@ | ||
# Reusable workflow to perform checks and generate conditions for other workflows. | ||
# Currently it checks if any Rust (build-related) file is changed | ||
# and if the current (caller) workflow file is changed. | ||
# Example: | ||
# | ||
# jobs: | ||
# changes: | ||
# permissions: | ||
# pull-requests: read | ||
# uses: ./.github/workflows/reusable-check-changed-files.yml | ||
# some-job: | ||
# needs: changes | ||
# if: ${{ needs.changes.outputs.rust }} | ||
# ....... | ||
|
||
name: Check changes files | ||
|
||
on: | ||
workflow_call: | ||
# Map the workflow outputs to job outputs | ||
outputs: | ||
rust: | ||
value: ${{ jobs.changes.outputs.rust }} | ||
description: "true if any of the build-related OR current (caller) workflow files have changed" | ||
current-workflow: | ||
value: ${{ jobs.changes.outputs.current-workflow }} | ||
description: "true if current (caller) workflow file has changed" | ||
|
||
jobs: | ||
changes: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: read | ||
outputs: | ||
# true if current workflow (caller) file is changed | ||
rust: ${{ steps.filter.outputs.rust == 'true' || steps.filter.outputs.current-workflow == 'true' }} | ||
current-workflow: ${{ steps.filter.outputs.current-workflow }} | ||
steps: | ||
- id: current-file | ||
run: echo "current-workflow-file=$(echo ${{ github.workflow_ref }} | sed -nE "s/.*(\.github\/workflows\/[a-zA-Z0-9_-]*\.y[a]?ml)@refs.*/\1/p")" >> $GITHUB_OUTPUT | ||
- run: echo "${{ steps.current-file.outputs.current-workflow-file }}" | ||
# For pull requests it's not necessary to checkout the code | ||
- name: Checkout | ||
if: github.event_name != 'pull_request' | ||
uses: actions/checkout@v4 | ||
- id: filter | ||
uses: dorny/paths-filter@v3 | ||
with: | ||
predicate-quantifier: "every" | ||
# current-workflow - check if the current (caller) workflow file is changed | ||
# rust - check if any Rust (build-related) file is changed | ||
filters: | | ||
current-workflow: | ||
- '${{ steps.current-file.outputs.current-workflow-file }}' | ||
rust: | ||
- '**/*' | ||
- '!.github/**/*' | ||
- '!prdoc/**/*' | ||
- '!docs/**/*' |
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
Oops, something went wrong.
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.
Would it make sense to use forklift caching to decide if something changed?
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.
forklift will know about changes only during
cargo build
and this action is for skipping entire workflows if no rust code has changedThere 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.
Yea but there could be a
forklift --did-something-change
? Trying to manually re-list all files that could trigger a build seems more fragile. But maybe its not the objective of forklift to offer this...