Skip to content

Commit d1ace92

Browse files
committed
Update bench-update-weights-weekly.yml
1 parent 1bc4f70 commit d1ace92

1 file changed

Lines changed: 8 additions & 30 deletions

File tree

.github/workflows/bench-update-weights-weekly.yml

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
name: Weekly update of benchmarks (frame-omni-bencher)
22

33
on:
4-
pull_request:
54
schedule:
65
- cron: '0 1 * * 0' # weekly on Sunday night 01:00 UTC
76

8-
concurrency:
9-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10-
cancel-in-progress: true
11-
127
permissions: # allow the action to create a PR
138
contents: write
149
issues: write
@@ -22,7 +17,6 @@ jobs:
2217
runtime-matrix:
2318
runs-on: ubuntu-latest
2419
needs: [preflight]
25-
if: ${{ needs.preflight.outputs.changes_rust }}
2620
timeout-minutes: 30
2721
outputs:
2822
runtime: ${{ steps.runtime.outputs.runtime }}
@@ -34,7 +28,7 @@ jobs:
3428
- id: runtime
3529
run: |
3630
# only first two runtimes
37-
RUNTIMES=$(jq '[.[] | select(.package != null)]' .github/workflows/runtimes-matrix.json | jq '.[0:2]')
31+
RUNTIMES=$(jq '[.[] | select(.package != null)]' .github/workflows/runtimes-matrix.json)
3832
3933
RUNTIMES=$(echo $RUNTIMES | jq -c .)
4034
echo "runtime=$RUNTIMES"
@@ -43,7 +37,6 @@ jobs:
4337
run-frame-omni-bencher:
4438
runs-on: ${{ needs.preflight.outputs.RUNNER_WEIGHTS }}
4539
needs: [preflight, runtime-matrix]
46-
if: ${{ needs.preflight.outputs.changes_rust }}
4740
timeout-minutes: 1440 # 24 hours per runtime
4841
strategy:
4942
fail-fast: false # keep running other workflows even if one fails, to see the logs of all possible failures
@@ -63,17 +56,14 @@ jobs:
6356
fetch-depth: 0
6457
ref: master
6558

66-
6759
- name: script
6860
id: required
6961
run: |
70-
cargo install subweight --locked
71-
cargo install --path substrate/utils/frame/omni-bencher --locked
7262
# Fixes "detected dubious ownership" error in the ci
7363
git config --global --add safe.directory '*'
7464
git remote -v
7565
python3 -m pip install -r .github/scripts/generate-prdoc.requirements.txt
76-
python3 .github/scripts/cmd/cmd.py bench --runtime ${{ matrix.runtime.name }} --pallet pallet_balances
66+
python3 .github/scripts/cmd/cmd.py bench --runtime ${{ matrix.runtime.name }}
7767
git add .
7868
git status
7969
@@ -100,6 +90,9 @@ jobs:
10090
steps:
10191
- name: Checkout
10292
uses: actions/checkout@v4
93+
with:
94+
fetch-depth: 0
95+
ref: master
10396

10497
- name: Download all artifacts
10598
uses: actions/download-artifact@v4
@@ -113,6 +106,8 @@ jobs:
113106
private-key: ${{ secrets.CMD_BOT_APP_KEY }}
114107

115108
- name: Apply diff from artifacts folder
109+
env:
110+
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
116111
run: |
117112
# scan all patch files in the patches directory
118113
for file in patches/diff-*/diff-*.patch; do
@@ -134,21 +129,4 @@ jobs:
134129
git commit -m "Update all weights weekly for $DATE"
135130
git push --set-upstream origin "$BRANCH"
136131
git status
137-
gh auth login --with-token ${{ steps.generate_token.outputs.token }}
138-
gh pr create --title "Update weights weekly for $DATE" --body "Update weights weekly for $DATE"
139-
140-
confirm-frame-omni-benchers-passed:
141-
runs-on: ubuntu-latest
142-
name: All benchmarks passed
143-
needs: [run-frame-omni-bencher]
144-
if: always() && !cancelled()
145-
steps:
146-
- run: |
147-
tee resultfile <<< '${{ toJSON(needs) }}'
148-
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
149-
if [ $FAILURES -gt 0 ]; then
150-
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
151-
exit 1
152-
else
153-
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
154-
fi
132+
gh pr create --title "Update weights weekly for $DATE" --body "Update weights weekly for $DATE"

0 commit comments

Comments
 (0)