mirror of
https://gitlab.com/pezkuwichain/pezkuwi-sdk.git
synced 2026-10-21 03:06:29 +00:00
sync: mirror deployed github repo (chains + sanitized bridge), keep GitLab CI
Make this monorepo's tracked tree identical to the deployed github repo (github.com/pezkuwichain/pezkuwi-DKS): all RC/AH/People runtimes and framework carry the mainnet fixes (incl. U128CurrencyToVote everywhere, so the staking election stall cannot recur), and tools/usdt-bridge matches the current, public-safe custody tooling (real config/deploy units gitignored, secret-file locations and server IPs stripped, sanitized *.example templates committed). Only exception to the mirror: GitLab-native CI is preserved (.gitlab-ci.yml and .gitlab/), to be rebuilt to match the github CI pipeline in a follow-up.
This commit is contained in:
1 parent
82543bdfab
commit
d285d59108
736 files changed
+15082
-16359
No files matched your search
@@ -1,214 +0,0 @@
|
||||
name: Bench all runtimes
|
||||
|
||||
on:
|
||||
# schedule:
|
||||
# - cron: '0 1 * * 0' # weekly on Sunday night 01:00 UTC
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
draft:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Whether to create a draft PR"
|
||||
|
||||
permissions: # allow the action to create a PR
|
||||
contents: write
|
||||
issues: write
|
||||
pull-requests: write
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
preflight:
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
runtime-matrix:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [preflight]
|
||||
timeout-minutes: 30
|
||||
outputs:
|
||||
runtime: ${{ steps.runtime.outputs.runtime }}
|
||||
branch: ${{ steps.branch.outputs.branch }}
|
||||
date: ${{ steps.branch.outputs.date }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
name: Extract runtimes from matrix
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: master
|
||||
|
||||
- name: Extract runtimes
|
||||
id: runtime
|
||||
run: |
|
||||
RUNTIMES=$(jq '[.[] | select(.package != null)]' .github/workflows/runtimes-matrix.json)
|
||||
|
||||
RUNTIMES=$(echo $RUNTIMES | jq -c .)
|
||||
echo "runtime=$RUNTIMES"
|
||||
echo "runtime=$RUNTIMES" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create branch
|
||||
id: branch
|
||||
run: |
|
||||
DATE=$(date +'%Y-%m-%d-%s')
|
||||
BRANCH="update-weights-weekly-$DATE"
|
||||
# Fixes "detected dubious ownership" error in the ci
|
||||
git config --global --add safe.directory $GITHUB_WORKSPACE
|
||||
|
||||
git checkout -b $BRANCH
|
||||
git push --set-upstream origin $BRANCH
|
||||
|
||||
echo "date=$DATE" >> $GITHUB_OUTPUT
|
||||
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
|
||||
|
||||
run-pezframe-omni-bencher:
|
||||
needs: [preflight, runtime-matrix]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_WEIGHTS }}
|
||||
# 24 hours per runtime.
|
||||
# Max it takes 14hr for zagros to recalculate, but due to limited runners,
|
||||
# sometimes it can take longer.
|
||||
timeout-minutes: 1440
|
||||
strategy:
|
||||
fail-fast: false # keep running other workflows even if one fails, to see the logs of all possible failures
|
||||
matrix:
|
||||
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
PACKAGE_NAME: ${{ matrix.runtime.package }}
|
||||
FLAGS: ${{ matrix.runtime.bench_flags }}
|
||||
RUST_LOG: "frame_omni_bencher=info,pezkuwi_sdk_frame=info"
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ needs.runtime-matrix.outputs.branch }} # checkout always from the initially created branch to avoid conflicts
|
||||
|
||||
- name: script
|
||||
id: required
|
||||
run: |
|
||||
git --version
|
||||
# Fixes "detected dubious ownership" error in the ci
|
||||
git config --global --add safe.directory $GITHUB_WORKSPACE
|
||||
git remote -v
|
||||
python3 -m pip install -r .github/scripts/generate-prdoc.requirements.txt
|
||||
python3 .github/scripts/cmd/cmd.py bench --runtime ${{ matrix.runtime.name }}
|
||||
git add .
|
||||
git status
|
||||
|
||||
if [ -f /tmp/cmd/command_output.log ]; then
|
||||
CMD_OUTPUT=$(cat /tmp/cmd/command_output.log)
|
||||
# export to summary to display in the PR
|
||||
echo "$CMD_OUTPUT" >> $GITHUB_STEP_SUMMARY
|
||||
# should be multiline, otherwise it captures the first line only
|
||||
echo 'cmd_output<<EOF' >> $GITHUB_OUTPUT
|
||||
echo "$CMD_OUTPUT" >> $GITHUB_OUTPUT
|
||||
echo 'EOF' >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
# Create patch that includes both modifications and new files
|
||||
git add -A
|
||||
git diff --staged > diff-${{ matrix.runtime.name }}.patch -U0
|
||||
git reset
|
||||
|
||||
- name: Upload diff
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: diff-${{ matrix.runtime.name }}
|
||||
path: diff-${{ matrix.runtime.name }}.patch
|
||||
|
||||
apply-diff-commit:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [runtime-matrix, run-pezframe-omni-bencher]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ needs.runtime-matrix.outputs.branch }}
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
path: patches
|
||||
|
||||
# needs to be able to trigger CI
|
||||
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
|
||||
id: generate_token
|
||||
with:
|
||||
app-id: ${{ secrets.CMD_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.CMD_BOT_APP_KEY }}
|
||||
|
||||
- name: Apply diff and create PR
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||
BRANCH: ${{ needs.runtime-matrix.outputs.branch }}
|
||||
DATE: ${{ needs.runtime-matrix.outputs.date }}
|
||||
run: |
|
||||
git --version
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
git status
|
||||
|
||||
# Apply all patches
|
||||
for file in patches/diff-*/diff-*.patch; do
|
||||
if [ -f "$file" ] && [ -s "$file" ]; then
|
||||
echo "Applying $file"
|
||||
# using --3way and --ours for conflicts resolution. Requires git 2.47+
|
||||
git apply "$file" --unidiff-zero --allow-empty --3way --ours || echo "Failed to apply $file"
|
||||
else
|
||||
echo "Skipping empty or non-existent patch file: $file"
|
||||
fi
|
||||
done
|
||||
|
||||
rm -rf patches
|
||||
|
||||
# Get release tags from 1 and 3 months ago
|
||||
ONE_MONTH_AGO=$(date -d "1 month ago" +%Y-%m-%d)
|
||||
THREE_MONTHS_AGO=$(date -d "3 months ago" +%Y-%m-%d)
|
||||
|
||||
# Get tags with their dates
|
||||
ONE_MONTH_INFO=$(git for-each-ref --sort=-creatordate --format '%(refname:short)|%(creatordate:iso-strict-local)' 'refs/tags/pezkuwi-v*' | awk -v date="$ONE_MONTH_AGO" -F'|' '$2 <= date {print $0; exit}')
|
||||
THREE_MONTHS_INFO=$(git for-each-ref --sort=-creatordate --format '%(refname:short)|%(creatordate:iso-strict-local)' 'refs/tags/pezkuwi-v*' | awk -v date="$THREE_MONTHS_AGO" -F'|' '$2 <= date {print $0; exit}')
|
||||
|
||||
# Split into tag and date
|
||||
ONE_MONTH_TAG=$(echo "$ONE_MONTH_INFO" | cut -d'|' -f1)
|
||||
ONE_MONTH_DATE=$(echo "$ONE_MONTH_INFO" | cut -d'|' -f2 | cut -d'T' -f1)
|
||||
THREE_MONTHS_TAG=$(echo "$THREE_MONTHS_INFO" | cut -d'|' -f1)
|
||||
THREE_MONTHS_DATE=$(echo "$THREE_MONTHS_INFO" | cut -d'|' -f2 | cut -d'T' -f1)
|
||||
|
||||
# Base URL for Subweight comparisons
|
||||
BASE_URL="https://weights.tasty.limo/compare?repo=pezkuwi-sdk&threshold=5&path_pattern=.%2F**%2Fweights%2F**%2F*.rs%2C.%2F**%2Fweights.rs&method=asymptotic&ignore_errors=true&unit=time"
|
||||
|
||||
# Generate comparison links
|
||||
MASTER_LINK="${BASE_URL}&old=master&new=${BRANCH}"
|
||||
ONE_MONTH_LINK="${BASE_URL}&old=${ONE_MONTH_TAG}&new=${BRANCH}"
|
||||
THREE_MONTHS_LINK="${BASE_URL}&old=${THREE_MONTHS_TAG}&new=${BRANCH}"
|
||||
|
||||
# Create PR body with all links in a temporary file
|
||||
cat > /tmp/pr_body.md << EOF
|
||||
Auto-update of all weights for ${DATE}.
|
||||
|
||||
Subweight results:
|
||||
- [now vs master](${MASTER_LINK})
|
||||
- [now vs ${ONE_MONTH_TAG} (${ONE_MONTH_DATE})](${ONE_MONTH_LINK})
|
||||
- [now vs ${THREE_MONTHS_TAG} (${THREE_MONTHS_DATE})](${THREE_MONTHS_LINK})
|
||||
EOF
|
||||
|
||||
git add .
|
||||
git commit -m "Update all weights weekly for $DATE"
|
||||
git push --set-upstream origin "$BRANCH"
|
||||
|
||||
MAYBE_DRAFT=${{ inputs.draft && '--draft' || '' }}
|
||||
|
||||
PR_TITLE="Auto-update of all weights for $DATE"
|
||||
gh pr create \
|
||||
--title "$PR_TITLE" \
|
||||
--head "$BRANCH" \
|
||||
--base "master" \
|
||||
--reviewer pezkuwichain/ci \
|
||||
--reviewer pezkuwichain/release-engineering \
|
||||
$MAYBE_DRAFT \
|
||||
--label "R0-no-crate-publish-required" \
|
||||
--body "$(cat /tmp/pr_body.md)"
|
||||
@@ -1,109 +0,0 @@
|
||||
name: Networking Benchmarks
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
preflight:
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
build:
|
||||
timeout-minutes: 50
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_BENCHMARK }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
features:
|
||||
[
|
||||
{ bench: "notifications_protocol" },
|
||||
{ bench: "request_response_protocol" },
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Run Benchmarks
|
||||
id: run-benchmarks
|
||||
run: |
|
||||
mkdir -p ./charts
|
||||
cargo bench -p pezsc-network --bench ${{ matrix.features.bench }} -- --output-format bencher | grep "^test" | tee ./charts/${{ matrix.features.bench }}.txt || echo "Benchmarks failed"
|
||||
ls -lsa ./charts
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ matrix.features.bench }}-${{ github.sha }}
|
||||
path: ./charts
|
||||
|
||||
publish-benchmarks:
|
||||
timeout-minutes: 60
|
||||
needs: [build]
|
||||
if: github.ref == 'refs/heads/master'
|
||||
environment: subsystem-benchmarks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: gh-pages
|
||||
fetch-depth: 0
|
||||
|
||||
- run: git checkout master --
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: notifications_protocol-${{ github.sha }}
|
||||
path: ./charts
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: request_response_protocol-${{ github.sha }}
|
||||
path: ./charts
|
||||
|
||||
- name: Setup git
|
||||
run: |
|
||||
# Fixes "detected dubious ownership" error in the ci
|
||||
git config --global --add safe.directory '*'
|
||||
ls -lsR ./charts
|
||||
|
||||
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ secrets.PEZKUWI_GHPAGES_APP_ID }}
|
||||
private-key: ${{ secrets.PEZKUWI_GHPAGES_APP_KEY }}
|
||||
|
||||
- name: Generate ${{ env.BENCH }}
|
||||
env:
|
||||
BENCH: notifications_protocol
|
||||
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
|
||||
with:
|
||||
tool: "cargo"
|
||||
name: ${{ env.BENCH }}
|
||||
output-file-path: ./charts/${{ env.BENCH }}.txt
|
||||
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
|
||||
github-token: ${{ steps.app-token.outputs.token }}
|
||||
auto-push: true
|
||||
|
||||
- name: Generate ${{ env.BENCH }}
|
||||
env:
|
||||
BENCH: request_response_protocol
|
||||
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
|
||||
with:
|
||||
tool: "cargo"
|
||||
name: ${{ env.BENCH }}
|
||||
output-file-path: ./charts/${{ env.BENCH }}.txt
|
||||
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
|
||||
github-token: ${{ steps.app-token.outputs.token }}
|
||||
auto-push: true
|
||||
@@ -1,167 +0,0 @@
|
||||
name: Subsystem Benchmarks
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
build:
|
||||
timeout-minutes: 80
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
features:
|
||||
[
|
||||
{
|
||||
name: "pezkuwi-availability-recovery",
|
||||
bench: "availability-recovery-regression-bench",
|
||||
},
|
||||
{
|
||||
name: "pezkuwi-availability-distribution",
|
||||
bench: "availability-distribution-regression-bench",
|
||||
},
|
||||
{
|
||||
name: "pezkuwi-node-core-approval-voting",
|
||||
bench: "approval-voting-regression-bench",
|
||||
},
|
||||
{
|
||||
name: "pezkuwi-statement-distribution",
|
||||
bench: "statement-distribution-regression-bench",
|
||||
},
|
||||
{
|
||||
name: "pezkuwi-node-core-dispute-coordinator",
|
||||
bench: "dispute-coordinator-regression-bench",
|
||||
},
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Check Rust
|
||||
run: |
|
||||
rustup show
|
||||
rustup +nightly show
|
||||
|
||||
- name: Run Benchmarks
|
||||
id: run-benchmarks
|
||||
run: |
|
||||
cargo bench -p ${{ matrix.features.name }} --bench ${{ matrix.features.bench }} --features subsystem-benchmarks
|
||||
ls -lsa ./charts
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{matrix.features.bench}}
|
||||
path: ./charts
|
||||
|
||||
publish-benchmarks:
|
||||
timeout-minutes: 60
|
||||
needs: [build]
|
||||
if: github.ref == 'refs/heads/master'
|
||||
environment: subsystem-benchmarks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: gh-pages
|
||||
fetch-depth: 0
|
||||
|
||||
- run: git checkout master --
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
path: ./charts
|
||||
|
||||
- name: Setup git
|
||||
run: |
|
||||
# Fixes "detected dubious ownership" error in the ci
|
||||
git config --global --add safe.directory '*'
|
||||
ls -lsR ./charts
|
||||
|
||||
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ secrets.PEZKUWI_GHPAGES_APP_ID }}
|
||||
private-key: ${{ secrets.PEZKUWI_GHPAGES_APP_KEY }}
|
||||
|
||||
- name: Generate ${{ env.BENCH }}
|
||||
env:
|
||||
BENCH: availability-recovery-regression-bench
|
||||
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
|
||||
with:
|
||||
tool: "customSmallerIsBetter"
|
||||
name: ${{ env.BENCH }}
|
||||
output-file-path: ./charts/${{ env.BENCH }}/${{ env.BENCH }}.json
|
||||
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
|
||||
github-token: ${{ steps.app-token.outputs.token }}
|
||||
auto-push: true
|
||||
max-items-in-chart: 500
|
||||
|
||||
- name: Generate ${{ env.BENCH }}
|
||||
env:
|
||||
BENCH: availability-distribution-regression-bench
|
||||
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
|
||||
with:
|
||||
tool: "customSmallerIsBetter"
|
||||
name: ${{ env.BENCH }}
|
||||
output-file-path: ./charts/${{ env.BENCH }}/${{ env.BENCH }}.json
|
||||
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
|
||||
github-token: ${{ steps.app-token.outputs.token }}
|
||||
auto-push: true
|
||||
max-items-in-chart: 500
|
||||
|
||||
- name: Generate ${{ env.BENCH }}
|
||||
env:
|
||||
BENCH: approval-voting-regression-bench
|
||||
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
|
||||
with:
|
||||
tool: "customSmallerIsBetter"
|
||||
name: ${{ env.BENCH }}
|
||||
output-file-path: ./charts/${{ env.BENCH }}/${{ env.BENCH }}.json
|
||||
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
|
||||
github-token: ${{ steps.app-token.outputs.token }}
|
||||
auto-push: true
|
||||
max-items-in-chart: 500
|
||||
|
||||
- name: Generate ${{ env.BENCH }}
|
||||
env:
|
||||
BENCH: statement-distribution-regression-bench
|
||||
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
|
||||
with:
|
||||
tool: "customSmallerIsBetter"
|
||||
name: ${{ env.BENCH }}
|
||||
output-file-path: ./charts/${{ env.BENCH }}/${{ env.BENCH }}.json
|
||||
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
|
||||
github-token: ${{ steps.app-token.outputs.token }}
|
||||
auto-push: true
|
||||
max-items-in-chart: 500
|
||||
|
||||
- name: Generate ${{ env.BENCH }}
|
||||
env:
|
||||
BENCH: dispute-coordinator-regression-bench
|
||||
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
|
||||
with:
|
||||
tool: "customSmallerIsBetter"
|
||||
name: ${{ env.BENCH }}
|
||||
output-file-path: ./charts/${{ env.BENCH }}/${{ env.BENCH }}.json
|
||||
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
|
||||
github-token: ${{ steps.app-token.outputs.token }}
|
||||
auto-push: true
|
||||
max-items-in-chart: 500
|
||||
@@ -1,139 +0,0 @@
|
||||
name: Build Misc
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
merge_group:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
build-runtimes-polkavm:
|
||||
timeout-minutes: 75
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Clean cargo cache to free disk space
|
||||
run: |
|
||||
cargo clean 2>/dev/null || true
|
||||
rm -rf ~/.cargo/registry/cache 2>/dev/null || true
|
||||
rm -rf ~/.cargo/git/db 2>/dev/null || true
|
||||
|
||||
- name: Check Rust
|
||||
run: |
|
||||
rustup show
|
||||
rustup +nightly show
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
BIZINIKIWI_RUNTIME_TARGET: riscv
|
||||
# Skip WASM build - this job tests PolkaVM (RISC-V) target only
|
||||
# Tracking: https://github.com/pezkuwichain/pezkuwi-sdk/issues/358
|
||||
SKIP_WASM_BUILD: 1
|
||||
id: required
|
||||
run: cargo check -p pez-minimal-template-runtime -p zagros-runtime -p pezkuwichain-runtime -p pezkuwi-test-runtime
|
||||
- name: Stop all workflows if failed
|
||||
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
|
||||
uses: ./.github/actions/workflow-stopper
|
||||
with:
|
||||
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
|
||||
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}
|
||||
|
||||
# As part of our test fixtures we build the revive-uapi crate always with the `unstable-hostfn` feature.
|
||||
# To make sure that it won't break for users downstream which are not setting this feature
|
||||
# It doesn't need to produce working code so we just use a similar enough RISC-V target
|
||||
check-revive-stable-uapi-polkavm:
|
||||
timeout-minutes: 30
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Check Rust
|
||||
run: |
|
||||
rustup show
|
||||
rustup +nightly show
|
||||
|
||||
- name: Build
|
||||
id: required
|
||||
run: cargo +nightly check -p pezpallet-revive-uapi --no-default-features --target riscv64imac-unknown-none-elf -Zbuild-std=core
|
||||
- name: Stop all workflows if failed
|
||||
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
|
||||
uses: ./.github/actions/workflow-stopper
|
||||
with:
|
||||
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
|
||||
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}
|
||||
|
||||
build-pez-subkey:
|
||||
timeout-minutes: 45
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Check Rust
|
||||
run: |
|
||||
rustup show
|
||||
rustup +nightly show
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
SKIP_WASM_BUILD: 1
|
||||
id: required
|
||||
run: |
|
||||
cd ./bizinikiwi/bin/utils/pez-subkey
|
||||
cargo build --locked --release
|
||||
- name: Stop all workflows if failed
|
||||
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
|
||||
uses: ./.github/actions/workflow-stopper
|
||||
with:
|
||||
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
|
||||
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}
|
||||
|
||||
confirm-required-build-mipezsc-jobs-passed:
|
||||
runs-on: ubuntu-latest
|
||||
name: All build misc jobs passed
|
||||
# If any new job gets added, be sure to add it to this array
|
||||
needs: [build-runtimes-polkavm, build-pez-subkey]
|
||||
if: always() && !cancelled()
|
||||
steps:
|
||||
- run: |
|
||||
tee resultfile <<< '${{ toJSON(needs) }}'
|
||||
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
|
||||
if [ $FAILURES -gt 0 ]; then
|
||||
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
@@ -1,82 +0,0 @@
|
||||
name: Build and push ETH-RPC image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
ETH_RPC_IMAGE_NAME: "docker.io/pezkuwi/eth-rpc"
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
set-variables:
|
||||
# This workaround sets the container image for each job using 'set-variables' job output.
|
||||
# env variables don't work for PR from forks, so we need to use outputs.
|
||||
runs-on: ubuntu-latest
|
||||
needs: isdraft
|
||||
outputs:
|
||||
VERSION: ${{ steps.version.outputs.VERSION }}
|
||||
steps:
|
||||
- name: Define version
|
||||
id: version
|
||||
run: |
|
||||
export COMMIT_SHA=${{ github.sha }}
|
||||
export COMMIT_SHA_SHORT=${COMMIT_SHA:0:8}
|
||||
export REF_NAME=${{ github.ref_name }}
|
||||
export REF_SLUG=${REF_NAME//\//_}
|
||||
VERSION=${REF_SLUG}-${COMMIT_SHA_SHORT}
|
||||
echo "VERSION=${REF_SLUG}-${COMMIT_SHA_SHORT}" >> $GITHUB_OUTPUT
|
||||
echo "set VERSION=${VERSION}"
|
||||
|
||||
build_docker:
|
||||
name: Build docker images
|
||||
runs-on: ubuntu-latest
|
||||
needs: [set-variables]
|
||||
env:
|
||||
VERSION: ${{ needs.set-variables.outputs.VERSION }}
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Build eth-rpc Docker image
|
||||
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
|
||||
with:
|
||||
context: .
|
||||
file: ./bizinikiwi/pezframe/revive/rpc/dockerfiles/eth-rpc/Dockerfile
|
||||
push: false
|
||||
tags: |
|
||||
${{ env.ETH_RPC_IMAGE_NAME }}:${{ env.VERSION }}
|
||||
|
||||
build_push_docker:
|
||||
name: Build and push docker images
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref == 'refs/heads/master'
|
||||
needs: [set-variables]
|
||||
env:
|
||||
VERSION: ${{ needs.set-variables.outputs.VERSION }}
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
|
||||
with:
|
||||
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Build eth-rpc Docker image
|
||||
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
|
||||
with:
|
||||
context: .
|
||||
file: ./bizinikiwi/pezframe/revive/rpc/dockerfiles/eth-rpc/Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.ETH_RPC_IMAGE_NAME }}:${{ env.VERSION }}
|
||||
@@ -1,576 +0,0 @@
|
||||
# GHA for build-*
|
||||
name: Build and push images
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
merge_group:
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: read-all
|
||||
|
||||
env:
|
||||
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
# Disable Parity's forklift GCS cache wrapper - we don't have GCP credentials on our VPS runners
|
||||
RUSTC_WRAPPER: ""
|
||||
|
||||
jobs:
|
||||
#
|
||||
#
|
||||
#
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
### Build ########################
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
build-linux-stable:
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
timeout-minutes: 180
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
RUST_TOOLCHAIN: stable
|
||||
# Enable debug assertions since we are running optimized builds for testing
|
||||
# but still want to have debug assertions.
|
||||
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Configure git safe.directory
|
||||
run: git config --global --add safe.directory '*'
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
- name: build
|
||||
id: required
|
||||
run: |
|
||||
cargo build --locked --profile testnet --features pyroscope,fast-runtime --bin pezkuwi --bin pezkuwi-prepare-worker --bin pezkuwi-execute-worker
|
||||
PEZKUWICHAIN_EPOCH_DURATION=10 ./pezkuwi/scripts/build-only-wasm.sh pezkuwichain-runtime $(pwd)/runtimes/pezkuwichain-runtime-10/
|
||||
PEZKUWICHAIN_EPOCH_DURATION=100 ./pezkuwi/scripts/build-only-wasm.sh pezkuwichain-runtime $(pwd)/runtimes/pezkuwichain-runtime-100/
|
||||
PEZKUWICHAIN_EPOCH_DURATION=600 ./pezkuwi/scripts/build-only-wasm.sh pezkuwichain-runtime $(pwd)/runtimes/pezkuwichain-runtime-600/
|
||||
pwd
|
||||
ls -alR runtimes
|
||||
- name: pack artifacts
|
||||
run: |
|
||||
mkdir -p ./artifacts
|
||||
VERSION="${{ needs.preflight.outputs.SOURCE_REF_SLUG }}" # will be tag or branch name
|
||||
mv ./target/testnet/pezkuwi ./artifacts/.
|
||||
mv ./target/testnet/pezkuwi-prepare-worker ./artifacts/.
|
||||
mv ./target/testnet/pezkuwi-execute-worker ./artifacts/.
|
||||
mv ./runtimes/ ./artifacts/.
|
||||
cd artifacts/
|
||||
sha256sum pezkuwi | tee pezkuwi.sha256
|
||||
shasum -c pezkuwi.sha256
|
||||
cd ../
|
||||
EXTRATAG="${{ needs.preflight.outputs.SOURCE_REF_SLUG }}-${COMMIT_SHA}"
|
||||
echo "Pezkuwi version = ${VERSION} (EXTRATAG = ${EXTRATAG})"
|
||||
echo -n ${VERSION} > ./artifacts/VERSION
|
||||
echo -n ${EXTRATAG} > ./artifacts/EXTRATAG
|
||||
echo -n ${GITHUB_RUN_ID} > ./artifacts/BUILD_LINUX_JOB_ID
|
||||
RELEASE_VERSION=$(./artifacts/pezkuwi -V | awk '{print $2}'| awk -F "-" '{print $1}')
|
||||
echo -n "v${RELEASE_VERSION}" > ./artifacts/BUILD_RELEASE_VERSION
|
||||
cp -r docker/* ./artifacts
|
||||
|
||||
- name: tar
|
||||
run: tar -cvf artifacts.tar artifacts
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
path: artifacts.tar
|
||||
retention-days: 1
|
||||
#
|
||||
#
|
||||
#
|
||||
build-linux-stable-pezcumulus:
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
timeout-minutes: 180
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
- name: build
|
||||
id: required
|
||||
run: |
|
||||
echo "___Building a binary, please refrain from using it in production since it goes with the debug assertions.___"
|
||||
cargo build --release --locked -p pezkuwi-teyrchain-bin --bin pezkuwi-teyrchain
|
||||
echo "___Packing the artifacts___"
|
||||
mkdir -p ./artifacts
|
||||
mv ./target/release/pezkuwi-teyrchain ./artifacts/.
|
||||
echo "___The VERSION is either a tag name or the curent branch if triggered not by a tag___"
|
||||
echo ${{ needs.preflight.outputs.SOURCE_REF_SLUG }} | tee ./artifacts/VERSION
|
||||
|
||||
- name: tar
|
||||
run: tar -cvf artifacts.tar artifacts
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
path: artifacts.tar
|
||||
retention-days: 1
|
||||
#
|
||||
#
|
||||
#
|
||||
build-test-teyrchain:
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
timeout-minutes: 180
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
- name: build
|
||||
id: required
|
||||
run: |
|
||||
echo "___Building a binary, please refrain from using it in production since it goes with the debug assertions.___"
|
||||
cargo build --release --locked -p pezcumulus-test-service --bin test-teyrchain
|
||||
- name: pack artifacts
|
||||
run: |
|
||||
echo "___Packing the artifacts___"
|
||||
mkdir -p ./artifacts
|
||||
mv ./target/release/test-teyrchain ./artifacts/.
|
||||
mkdir -p ./artifacts/zombienet
|
||||
mv ./target/release/wbuild/pezcumulus-test-runtime/wasm_binary_spec_version_incremented.rs.compact.compressed.wasm ./artifacts/zombienet/.
|
||||
mv ./target/release/wbuild/pezcumulus-test-runtime/wasm_binary_elastic_scaling.rs.compact.compressed.wasm ./artifacts/zombienet/.
|
||||
mv ./target/release/wbuild/pezcumulus-test-runtime/wasm_binary_elastic_scaling_12s_slot.rs.compact.compressed.wasm ./artifacts/zombienet/.
|
||||
|
||||
- name: tar
|
||||
run: tar -cvf artifacts.tar artifacts
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
path: artifacts.tar
|
||||
retention-days: 1
|
||||
#
|
||||
#
|
||||
#
|
||||
build-test-collators:
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
timeout-minutes: 180
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
- name: build
|
||||
id: required
|
||||
run: |
|
||||
cargo build --locked --profile testnet -p test-teyrchain-adder-collator
|
||||
cargo build --locked --profile testnet -p test-teyrchain-undying-collator
|
||||
- name: pack artifacts
|
||||
run: |
|
||||
mkdir -p ./artifacts
|
||||
mv ./target/testnet/adder-collator ./artifacts/.
|
||||
mv ./target/testnet/undying-collator ./artifacts/.
|
||||
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}" > ./artifacts/VERSION
|
||||
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}-${COMMIT_SHA}" > ./artifacts/EXTRATAG
|
||||
echo "adder-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
|
||||
echo "undying-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
|
||||
cp -r ./docker/* ./artifacts
|
||||
|
||||
- name: tar
|
||||
run: tar -cvf artifacts.tar artifacts
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
path: artifacts.tar
|
||||
retention-days: 1
|
||||
#
|
||||
#
|
||||
#
|
||||
build-malus:
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
timeout-minutes: 180
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
- name: build
|
||||
id: required
|
||||
run: |
|
||||
cargo build --locked --profile testnet -p pezkuwi-test-malus --bin malus --bin pezkuwi-prepare-worker --bin pezkuwi-execute-worker
|
||||
- name: pack artifacts
|
||||
run: |
|
||||
mkdir -p ./artifacts
|
||||
mv ./target/testnet/malus ./artifacts/.
|
||||
mv ./target/testnet/pezkuwi-execute-worker ./artifacts/.
|
||||
mv ./target/testnet/pezkuwi-prepare-worker ./artifacts/.
|
||||
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}" > ./artifacts/VERSION
|
||||
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}-${COMMIT_SHA}" > ./artifacts/EXTRATAG
|
||||
echo "pezkuwi-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
|
||||
cp -r ./docker/* ./artifacts
|
||||
|
||||
- name: tar
|
||||
run: tar -cvf artifacts.tar artifacts
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
path: artifacts.tar
|
||||
retention-days: 1
|
||||
#
|
||||
#
|
||||
#
|
||||
build-linux-bizinikiwi:
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
timeout-minutes: 180
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Configure git safe.directory
|
||||
run: git config --global --add safe.directory '*'
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
- name: build
|
||||
id: required
|
||||
run: |
|
||||
mkdir -p ./artifacts/bizinikiwi/
|
||||
WASM_BUILD_NO_COLOR=1 cargo build --locked --release -p pezstaging-node-cli
|
||||
ls -la target/release/
|
||||
- name: pack artifacts
|
||||
shell: bash
|
||||
run: |
|
||||
mv target/release/bizinikiwi-node ./artifacts/bizinikiwi/bizinikiwi
|
||||
echo -n "Bizinikiwi version = "
|
||||
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
||||
echo "${{ github.ref_name }}" | tee ./artifacts/bizinikiwi/VERSION;
|
||||
else
|
||||
./artifacts/bizinikiwi/bizinikiwi --version |
|
||||
cut -d ' ' -f 2 | tee ./artifacts/bizinikiwi/VERSION;
|
||||
fi
|
||||
sha256sum ./artifacts/bizinikiwi/bizinikiwi | tee ./artifacts/bizinikiwi/bizinikiwi.sha256
|
||||
cp -r ./docker/dockerfiles/bizinikiwi_injected.Dockerfile ./artifacts/bizinikiwi/
|
||||
|
||||
- name: tar
|
||||
run: tar -cvf artifacts.tar artifacts
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
path: artifacts.tar
|
||||
retention-days: 1
|
||||
#
|
||||
#
|
||||
#
|
||||
build-templates-node:
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
timeout-minutes: 180
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
- name: build
|
||||
id: required
|
||||
run: |
|
||||
cargo build --locked --package teyrchain-template-node --release
|
||||
cargo build --locked --package pez-minimal-template-node --release
|
||||
cargo build --locked --package pez-solochain-template-node --release
|
||||
- name: pack artifacts
|
||||
run: |
|
||||
mkdir -p ./artifacts
|
||||
mv ./target/release/teyrchain-template-node ./artifacts/.
|
||||
mv ./target/release/pez-minimal-template-node ./artifacts/.
|
||||
mv ./target/release/pez-solochain-template-node ./artifacts/.
|
||||
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}" > ./artifacts/VERSION
|
||||
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}-${COMMIT_SHA}" > ./artifacts/EXTRATAG
|
||||
echo "pezkuwi-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
|
||||
|
||||
- name: tar
|
||||
run: tar -cvf artifacts.tar artifacts
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
path: artifacts.tar
|
||||
retention-days: 1
|
||||
|
||||
|
||||
### Publish ########################
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
build-push-image-test-teyrchain:
|
||||
needs: [preflight, build-test-teyrchain]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
|
||||
timeout-minutes: 180
|
||||
steps:
|
||||
- name: Fix workspace permissions
|
||||
run: |
|
||||
sudo chown -R "$(whoami)" "$GITHUB_WORKSPACE" || {
|
||||
echo "::warning::sudo chown failed - attempting cleanup"
|
||||
rm -rf "${GITHUB_WORKSPACE:?}"/* 2>/dev/null || true
|
||||
rm -rf "${GITHUB_WORKSPACE:?}"/.[!.]* 2>/dev/null || true
|
||||
}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: build-test-teyrchain-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
|
||||
- name: tar
|
||||
run: tar -xvf artifacts.tar
|
||||
|
||||
- name: build and push image
|
||||
uses: ./.github/actions/build-push-image
|
||||
with:
|
||||
image-name: "test-teyrchain"
|
||||
dockerfile: "docker/dockerfiles/test-teyrchain_injected.Dockerfile"
|
||||
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
build-push-image-pezkuwi-debug:
|
||||
needs: [preflight, build-linux-stable]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
|
||||
timeout-minutes: 180
|
||||
steps:
|
||||
- name: Fix workspace permissions
|
||||
run: |
|
||||
sudo chown -R "$(whoami)" "$GITHUB_WORKSPACE" || {
|
||||
echo "::warning::sudo chown failed - attempting cleanup"
|
||||
rm -rf "${GITHUB_WORKSPACE:?}"/* 2>/dev/null || true
|
||||
rm -rf "${GITHUB_WORKSPACE:?}"/.[!.]* 2>/dev/null || true
|
||||
}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: build-linux-stable-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
|
||||
- name: tar
|
||||
run: tar -xvf artifacts.tar
|
||||
|
||||
- name: build and push image
|
||||
uses: ./.github/actions/build-push-image
|
||||
with:
|
||||
image-name: "pezkuwi-debug"
|
||||
dockerfile: "docker/dockerfiles/pezkuwi/pezkuwi_injected_debug.Dockerfile"
|
||||
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
build-push-image-colander:
|
||||
needs: [preflight, build-test-collators]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
|
||||
timeout-minutes: 180
|
||||
steps:
|
||||
- name: Fix workspace permissions
|
||||
run: |
|
||||
sudo chown -R "$(whoami)" "$GITHUB_WORKSPACE" || {
|
||||
echo "::warning::sudo chown failed - attempting cleanup"
|
||||
rm -rf "${GITHUB_WORKSPACE:?}"/* 2>/dev/null || true
|
||||
rm -rf "${GITHUB_WORKSPACE:?}"/.[!.]* 2>/dev/null || true
|
||||
}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: build-test-collators-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
|
||||
- name: tar
|
||||
run: tar -xvf artifacts.tar
|
||||
|
||||
- name: build and push image
|
||||
uses: ./.github/actions/build-push-image
|
||||
with:
|
||||
image-name: "colander"
|
||||
dockerfile: "docker/dockerfiles/collator_injected.Dockerfile"
|
||||
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
build-push-image-malus:
|
||||
needs: [preflight, build-malus]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
|
||||
timeout-minutes: 180
|
||||
steps:
|
||||
- name: Fix workspace permissions
|
||||
run: |
|
||||
sudo chown -R "$(whoami)" "$GITHUB_WORKSPACE" || {
|
||||
echo "::warning::sudo chown failed - attempting cleanup"
|
||||
rm -rf "${GITHUB_WORKSPACE:?}"/* 2>/dev/null || true
|
||||
rm -rf "${GITHUB_WORKSPACE:?}"/.[!.]* 2>/dev/null || true
|
||||
}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: build-malus-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
|
||||
- name: tar
|
||||
run: tar -xvf artifacts.tar
|
||||
|
||||
- name: build and push image
|
||||
uses: ./.github/actions/build-push-image
|
||||
with:
|
||||
image-name: "malus"
|
||||
dockerfile: "docker/dockerfiles/malus_injected.Dockerfile"
|
||||
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
build-push-image-bizinikiwi-pr:
|
||||
needs: [preflight, build-linux-bizinikiwi]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
|
||||
timeout-minutes: 180
|
||||
steps:
|
||||
- name: Fix workspace permissions
|
||||
run: |
|
||||
sudo chown -R "$(whoami)" "$GITHUB_WORKSPACE" || {
|
||||
echo "::warning::sudo chown failed - attempting cleanup"
|
||||
rm -rf "${GITHUB_WORKSPACE:?}"/* 2>/dev/null || true
|
||||
rm -rf "${GITHUB_WORKSPACE:?}"/.[!.]* 2>/dev/null || true
|
||||
}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: build-linux-bizinikiwi-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
|
||||
- name: tar
|
||||
run: tar -xvf artifacts.tar
|
||||
|
||||
- name: build and push image
|
||||
uses: ./.github/actions/build-push-image
|
||||
with:
|
||||
image-name: "bizinikiwi"
|
||||
dockerfile: "docker/dockerfiles/bizinikiwi_injected.Dockerfile"
|
||||
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
build-push-image-pezkuwi-teyrchain-debug:
|
||||
needs: [preflight, build-linux-stable-pezcumulus]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
|
||||
timeout-minutes: 180
|
||||
steps:
|
||||
- name: Fix workspace permissions
|
||||
run: |
|
||||
sudo chown -R "$(whoami)" "$GITHUB_WORKSPACE" || {
|
||||
echo "::warning::sudo chown failed - attempting cleanup"
|
||||
rm -rf "${GITHUB_WORKSPACE:?}"/* 2>/dev/null || true
|
||||
rm -rf "${GITHUB_WORKSPACE:?}"/.[!.]* 2>/dev/null || true
|
||||
}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: build-linux-stable-pezcumulus-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
|
||||
- name: tar
|
||||
run: tar -xvf artifacts.tar
|
||||
|
||||
- name: build and push image
|
||||
uses: ./.github/actions/build-push-image
|
||||
with:
|
||||
image-name: "pezkuwi-teyrchain-debug"
|
||||
dockerfile: "docker/dockerfiles/pezkuwi-teyrchain/pezkuwi-teyrchain-debug_unsigned_injected.Dockerfile"
|
||||
username: ${{ secrets.PEZKUWI_DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.PEZKUWI_DOCKERHUB_PASSWORD }}
|
||||
|
||||
confirm-required-build-jobs-passed:
|
||||
runs-on: ubuntu-latest
|
||||
name: All builds passed
|
||||
# If any new job gets added, be sure to add it to this array
|
||||
needs:
|
||||
- build-linux-stable
|
||||
- build-linux-stable-pezcumulus
|
||||
- build-test-teyrchain
|
||||
- build-test-collators
|
||||
- build-malus
|
||||
- build-linux-bizinikiwi
|
||||
- build-templates-node
|
||||
if: always() && !cancelled()
|
||||
outputs:
|
||||
build_success: ${{ steps.check_success.outputs.build_success }}
|
||||
steps:
|
||||
- name: Check build success
|
||||
id: check_success
|
||||
run: |
|
||||
tee resultfile <<< '${{ toJSON(needs) }}'
|
||||
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
|
||||
if [ $FAILURES -gt 0 ]; then
|
||||
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
|
||||
echo "build_success=false" >> $GITHUB_OUTPUT
|
||||
exit 1
|
||||
else
|
||||
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
|
||||
echo "build_success=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
name: Check Cargo Check Runtimes
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
paths:
|
||||
- "pezcumulus/teyrchains/runtimes/*"
|
||||
|
||||
# Jobs in this workflow depend on each other, only for limiting peak amount of spawned workers
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
check-runtime-assets:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
needs: [preflight]
|
||||
timeout-minutes: 20
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Run cargo check
|
||||
uses: ./.github/actions/cargo-check-runtimes
|
||||
with:
|
||||
root: pezcumulus/teyrchains/runtimes/assets
|
||||
|
||||
check-runtime-collectives:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
needs: [check-runtime-assets, preflight]
|
||||
timeout-minutes: 20
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Run cargo check
|
||||
uses: ./.github/actions/cargo-check-runtimes
|
||||
with:
|
||||
root: pezcumulus/teyrchains/runtimes/collectives
|
||||
|
||||
check-runtime-coretime:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
needs: [check-runtime-assets, preflight]
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Run cargo check
|
||||
uses: ./.github/actions/cargo-check-runtimes
|
||||
with:
|
||||
root: pezcumulus/teyrchains/runtimes/coretime
|
||||
|
||||
check-runtime-bridge-hubs:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
needs: [preflight]
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Run cargo check
|
||||
uses: ./.github/actions/cargo-check-runtimes
|
||||
with:
|
||||
root: pezcumulus/teyrchains/runtimes/bridge-hubs
|
||||
|
||||
check-runtime-contracts:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
needs: [check-runtime-collectives, preflight]
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Run cargo check
|
||||
uses: ./.github/actions/cargo-check-runtimes
|
||||
with:
|
||||
root: pezcumulus/teyrchains/runtimes/contracts
|
||||
|
||||
check-runtime-testing:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
needs: [preflight]
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Run cargo check
|
||||
uses: ./.github/actions/cargo-check-runtimes
|
||||
with:
|
||||
root: pezcumulus/teyrchains/runtimes/testing
|
||||
|
||||
confirm-required-jobs-passed:
|
||||
runs-on: ubuntu-latest
|
||||
name: All check-runtime-* tests passed
|
||||
# If any new job gets added, be sure to add it to this array
|
||||
needs:
|
||||
- check-runtime-assets
|
||||
- check-runtime-collectives
|
||||
- check-runtime-coretime
|
||||
- check-runtime-bridge-hubs
|
||||
- check-runtime-contracts
|
||||
- check-runtime-testing
|
||||
if: always() && !cancelled()
|
||||
steps:
|
||||
- run: |
|
||||
tee resultfile <<< '${{ toJSON(needs) }}'
|
||||
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
|
||||
if [ $FAILURES -gt 0 ]; then
|
||||
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
@@ -1,327 +0,0 @@
|
||||
name: Check the getting-started.sh script
|
||||
|
||||
# This workflow aims to make sure that the `getting-started.sh` script
|
||||
# is functional and allows to build the templates
|
||||
# on different operating systems.
|
||||
#
|
||||
# There are two jobs inside.
|
||||
# One for systems that can run in a docker container, and one for macOS.
|
||||
#
|
||||
# Each job consists of:
|
||||
# 1. Some necessary prerequisites for the workflow itself.
|
||||
# 2. A first pass of the script, which will install dependencies and clone a template.
|
||||
# 3. A second pass of the script, to make sure the behaviour is as expected.
|
||||
# 4. Building the template - making sure it's buildable and runnable.
|
||||
#
|
||||
# The script is interacted with using the `expect` tool, which is available on all relevant systems.
|
||||
# The steps are not re-used between macOS and other systems,
|
||||
# because they are very similar but a little different.
|
||||
# Additionally, macOS does NOT start from scratch here - for example, we have homebrew already installed.
|
||||
#
|
||||
# There are many combinations of systems, shells and templates.
|
||||
# We test a selected handful of combinations here.
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/check-getting-started.yml"
|
||||
- "scripts/getting-started.sh"
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
schedule:
|
||||
- cron: "0 5 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
check-getting-started:
|
||||
needs: isdraft
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include:
|
||||
- name: ubuntu
|
||||
container: ubuntu
|
||||
template: minimal
|
||||
package: pez-minimal-template-node
|
||||
shell: bash
|
||||
- name: debian
|
||||
container: debian
|
||||
template: teyrchain
|
||||
package: teyrchain-template-node
|
||||
shell: sh
|
||||
- name: arch
|
||||
container: archlinux
|
||||
template: solochain
|
||||
package: pez-solochain-template-node
|
||||
shell: sh
|
||||
- name: fedora
|
||||
container: fedora
|
||||
template: teyrchain
|
||||
package: teyrchain-template-node
|
||||
shell: sh
|
||||
- name: opensuse
|
||||
container: opensuse/tumbleweed
|
||||
template: solochain
|
||||
package: pez-solochain-template-node
|
||||
shell: sh
|
||||
runs-on: ubuntu-latest
|
||||
container: ${{ matrix.container }}:latest
|
||||
env:
|
||||
# Use local templates from the repo instead of cloning from external repos
|
||||
PEZKUWI_TEMPLATE_SOURCE: ${{ github.workspace }}/templates
|
||||
# Fix HOME directory mismatch in containers (rustup requires this)
|
||||
HOME: /root
|
||||
steps:
|
||||
# A minimal amount of prerequisites required before we can run the actual getting-started script,
|
||||
# which will install the rest of requirements.
|
||||
- name: Install ubuntu/debian prerequisites
|
||||
run: apt update && apt install -y expect sudo git
|
||||
if: contains(matrix.name, 'ubuntu') || contains(matrix.name, 'debian')
|
||||
- name: Install arch prerequisites
|
||||
run: pacman -Syu --needed --noconfirm expect sudo git
|
||||
if: contains(matrix.name, 'arch')
|
||||
- name: Install fedora prerequisites
|
||||
run: dnf --assumeyes install expect sudo git
|
||||
if: contains(matrix.name, 'fedora')
|
||||
- name: Install opensuse prerequisites
|
||||
run: zypper install --no-confirm expect sudo git
|
||||
if: contains(matrix.name, 'opensuse')
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Set additional expect flags if necessary
|
||||
run: |
|
||||
# Add a debug flag to expect, if github is re-run with debug logging enabled.
|
||||
[ "${{ runner.debug }}" = "1" ] && EXPECT_FLAGS="-d" || EXPECT_FLAGS=""
|
||||
echo "EXPECT_FLAGS=${EXPECT_FLAGS}" >> $GITHUB_ENV
|
||||
|
||||
- name: Check the first run of the script
|
||||
run: |
|
||||
expect $EXPECT_FLAGS -c '
|
||||
set timeout 240
|
||||
|
||||
spawn ${{ matrix.shell }} scripts/getting-started.sh
|
||||
|
||||
expect_after {
|
||||
timeout { puts stderr "Timed out on an expect"; exit 1 }
|
||||
eof { puts stderr "EOF received on an expect"; exit 1 }
|
||||
}
|
||||
|
||||
expect -nocase "Detected ${{ matrix.name }}"
|
||||
|
||||
expect "*Rust is not installed. Install it?*" {
|
||||
send "y\r"
|
||||
# rustup runs with -y flag (non-interactive), so no "Proceed" prompt
|
||||
expect "Rust is installed now"
|
||||
}
|
||||
|
||||
expect "*Setup the Rust environment*" {
|
||||
send "y\r"
|
||||
}
|
||||
|
||||
expect "start with one of the templates" {
|
||||
send "y\r"
|
||||
}
|
||||
|
||||
expect -re "(.)\\) ${{ matrix.template }} template" {
|
||||
send "$expect_out(1,string)\r"
|
||||
}
|
||||
|
||||
expect "*compile the node?*" {
|
||||
send "n\r"
|
||||
}
|
||||
|
||||
expect eof
|
||||
'
|
||||
timeout-minutes: 15
|
||||
|
||||
- name: Check the second run of the script
|
||||
run: |
|
||||
expect $EXPECT_FLAGS -c '
|
||||
set timeout 120
|
||||
|
||||
spawn ${{ matrix.shell }} scripts/getting-started.sh
|
||||
|
||||
expect_after {
|
||||
timeout { puts stderr "Timed out on an expect"; exit 1 }
|
||||
eof { puts stderr "EOF received on an expect"; exit 1 }
|
||||
}
|
||||
|
||||
expect "Rust already installed" {}
|
||||
|
||||
expect "*Setup the Rust environment*" {
|
||||
send "n\r"
|
||||
}
|
||||
|
||||
expect "start with one of the templates" {
|
||||
send "y\r"
|
||||
}
|
||||
|
||||
expect -re "(.)\\) ${{ matrix.template }} template" {
|
||||
send "$expect_out(1,string)\r"
|
||||
expect "directory already exists" {}
|
||||
}
|
||||
|
||||
expect "*compile the node?*" {
|
||||
send "n\r"
|
||||
}
|
||||
|
||||
expect eof
|
||||
'
|
||||
timeout-minutes: 15
|
||||
|
||||
# Build the template from within the SDK workspace context
|
||||
# Templates use workspace inheritance and can't be built standalone
|
||||
# Note: Use $GITHUB_WORKSPACE env var, not ${{ github.workspace }} template
|
||||
# because inside containers the template expands to host path which doesn't exist
|
||||
- name: Compile the template node
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
cargo build --release -p ${{ matrix.package }}
|
||||
timeout-minutes: 120
|
||||
|
||||
- name: Check that the binary is executable
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
cargo run --release -p ${{ matrix.package }} -- --help
|
||||
timeout-minutes: 5
|
||||
|
||||
check-getting-started-macos:
|
||||
needs: isdraft
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include:
|
||||
- template: teyrchain
|
||||
package: teyrchain-template-node
|
||||
shell: sh
|
||||
- template: solochain
|
||||
package: pez-solochain-template-node
|
||||
shell: bash
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
# Use local templates from the repo instead of cloning from external repos
|
||||
PEZKUWI_TEMPLATE_SOURCE: ${{ github.workspace }}/templates
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Install LLVM (provides libclang for rocksdb)
|
||||
run: |
|
||||
brew install llvm
|
||||
echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> $GITHUB_ENV
|
||||
|
||||
- name: Set additional expect flags if necessary
|
||||
run: |
|
||||
# Add a debug flag to expect, if github is re-run with debug logging enabled.
|
||||
[ "${{ runner.debug }}" = "1" ] && EXPECT_FLAGS="-d" || EXPECT_FLAGS=""
|
||||
echo "EXPECT_FLAGS=${EXPECT_FLAGS}" >> $GITHUB_ENV
|
||||
|
||||
- name: Check the first run of the script
|
||||
run: |
|
||||
expect $EXPECT_FLAGS -c '
|
||||
set timeout 120
|
||||
|
||||
spawn ${{ matrix.shell }} scripts/getting-started.sh
|
||||
|
||||
expect_after {
|
||||
timeout { puts stderr "Timed out on an expect"; exit 1 }
|
||||
eof { puts stderr "EOF received on an expect"; exit 1 }
|
||||
}
|
||||
|
||||
expect -nocase "Detected macOS"
|
||||
|
||||
expect "Homebrew already installed"
|
||||
|
||||
expect "Install cmake" {
|
||||
send "y\r"
|
||||
}
|
||||
|
||||
expect "Rust already installed" {}
|
||||
|
||||
expect "*Setup the Rust environment*" {
|
||||
send "y\r"
|
||||
}
|
||||
|
||||
expect "start with one of the templates" {
|
||||
send "y\r"
|
||||
}
|
||||
|
||||
expect -re "(.)\\) ${{ matrix.template }} template" {
|
||||
send "$expect_out(1,string)\r"
|
||||
}
|
||||
|
||||
expect "*compile the node?*" {
|
||||
send "n\r"
|
||||
}
|
||||
|
||||
expect eof
|
||||
'
|
||||
timeout-minutes: 15
|
||||
|
||||
- name: Check the second run of the script
|
||||
run: |
|
||||
expect $EXPECT_FLAGS -c '
|
||||
set timeout 120
|
||||
|
||||
spawn ${{ matrix.shell }} scripts/getting-started.sh
|
||||
|
||||
expect_after {
|
||||
timeout { puts stderr "Timed out on an expect"; exit 1 }
|
||||
eof { puts stderr "EOF received on an expect"; exit 1 }
|
||||
}
|
||||
|
||||
expect "Homebrew already installed"
|
||||
|
||||
expect "Install cmake" {
|
||||
send "y\r"
|
||||
}
|
||||
|
||||
expect "Rust already installed" {}
|
||||
|
||||
expect "*Setup the Rust environment*" {
|
||||
send "n\r"
|
||||
}
|
||||
|
||||
expect "start with one of the templates" {
|
||||
send "y\r"
|
||||
}
|
||||
|
||||
expect -re "(.)\\) ${{ matrix.template }} template" {
|
||||
send "$expect_out(1,string)\r"
|
||||
expect "directory already exists" {}
|
||||
}
|
||||
|
||||
expect "*compile the node?*" {
|
||||
send "n\r"
|
||||
}
|
||||
|
||||
expect eof
|
||||
'
|
||||
timeout-minutes: 15
|
||||
|
||||
# Build the template from within the SDK workspace context
|
||||
# Templates use workspace inheritance and can't be built standalone
|
||||
# Note: Use $GITHUB_WORKSPACE env var, not ${{ github.workspace }} template
|
||||
# because inside containers the template expands to host path which doesn't exist
|
||||
- name: Compile the template node
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
cargo build --release -p ${{ matrix.package }}
|
||||
timeout-minutes: 120
|
||||
|
||||
- name: Check that the binary is executable
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
cargo run --release -p ${{ matrix.package }} -- --help
|
||||
timeout-minutes: 5
|
||||
@@ -1,55 +0,0 @@
|
||||
name: Check labels
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [labeled, opened, synchronize, unlabeled]
|
||||
merge_group:
|
||||
|
||||
jobs:
|
||||
check-labels:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Check labels
|
||||
env:
|
||||
GITHUB_PR: ${{ github.event.pull_request.number }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
API_BASE: https://api.github.com/repos
|
||||
REPO: ${{ github.repository }}
|
||||
run: |
|
||||
if [ ${{ github.ref }} == "refs/heads/master" ] || [ ${{ github.ref }} == "refs/heads/main" ]; then
|
||||
echo "Skipping main/master"
|
||||
exit 0
|
||||
fi
|
||||
if [ $(echo ${{ github.ref }} | grep -c "gh-readonly-queue") -eq 1 ]; then
|
||||
echo "Skipping merge queue"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "REPO: ${REPO}"
|
||||
echo "GITHUB_PR: ${GITHUB_PR}"
|
||||
|
||||
# Fetch the labels for the PR under test
|
||||
echo "Fetch the labels for $API_BASE/${REPO}/pulls/${GITHUB_PR}"
|
||||
labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" "," )
|
||||
echo "Labels: ${labels}"
|
||||
|
||||
# Basic label checks for Pezkuwi SDK
|
||||
# Check for required labels (customize as needed)
|
||||
if [ -z "${labels}" ]; then
|
||||
echo "::warning::No labels found on PR. Consider adding appropriate labels."
|
||||
else
|
||||
echo "Labels found: ${labels}"
|
||||
# Check for T- (type) labels
|
||||
if echo "${labels}" | grep -q '"T-'; then
|
||||
echo "Type label found"
|
||||
else
|
||||
echo "::notice::Consider adding a type label (T-*)"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Label check completed"
|
||||
@@ -1,98 +0,0 @@
|
||||
name: Check licenses
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
merge_group:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
packages: read
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
check-licenses:
|
||||
runs-on: ubuntu-latest
|
||||
needs: isdraft
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
LICENSES: "'Apache-2.0' 'GPL-3.0-only' 'GPL-3.0-or-later WITH Classpath-exception-2.0' 'MIT-0' 'Unlicense'"
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
with:
|
||||
node-version: "18.x"
|
||||
|
||||
# License check using grep-based approach (pezkuwichain license-scanner not available)
|
||||
- name: Check the licenses in Pezkuwi
|
||||
run: |
|
||||
echo "Checking license headers in ./pezkuwi..."
|
||||
# Check for Apache-2.0 or GPL-3.0 license headers
|
||||
MISSING=$(find ./pezkuwi -name "*.rs" -type f | head -100 | while read f; do
|
||||
if ! head -20 "$f" | grep -qiE "(apache|gpl|mit|unlicense)"; then
|
||||
echo "$f"
|
||||
fi
|
||||
done)
|
||||
if [ -n "$MISSING" ]; then
|
||||
echo "::warning::Some files may be missing license headers (sample check)"
|
||||
fi
|
||||
echo "License check completed for pezkuwi"
|
||||
|
||||
- name: Check the licenses in Pezcumulus
|
||||
run: |
|
||||
echo "Checking license headers in ./pezcumulus..."
|
||||
MISSING=$(find ./pezcumulus -name "*.rs" -type f | head -100 | while read f; do
|
||||
if ! head -20 "$f" | grep -qiE "(apache|gpl|mit|unlicense)"; then
|
||||
echo "$f"
|
||||
fi
|
||||
done)
|
||||
if [ -n "$MISSING" ]; then
|
||||
echo "::warning::Some files may be missing license headers (sample check)"
|
||||
fi
|
||||
echo "License check completed for pezcumulus"
|
||||
|
||||
- name: Check the licenses in Bizinikiwi
|
||||
run: |
|
||||
echo "Checking license headers in ./bizinikiwi..."
|
||||
MISSING=$(find ./bizinikiwi -name "*.rs" -type f | head -100 | while read f; do
|
||||
if ! head -20 "$f" | grep -qiE "(apache|gpl|mit|unlicense)"; then
|
||||
echo "$f"
|
||||
fi
|
||||
done)
|
||||
if [ -n "$MISSING" ]; then
|
||||
echo "::warning::Some files may be missing license headers (sample check)"
|
||||
fi
|
||||
echo "License check completed for bizinikiwi"
|
||||
|
||||
check-product-references:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
|
||||
# Product reference check using grep (pezkuwichain license-scanner not available)
|
||||
- name: Check the product references in Pezkuwi
|
||||
run: |
|
||||
echo "Checking product references in ./pezkuwi..."
|
||||
# Sample check for Pezkuwi product name in license headers
|
||||
COUNT=$(find ./pezkuwi -name "*.rs" -type f | head -50 | xargs grep -l "Pezkuwi\|PEZKUWI" 2>/dev/null | wc -l || echo 0)
|
||||
echo "Found $COUNT files with Pezkuwi product reference"
|
||||
|
||||
- name: Check the product references in Pezcumulus
|
||||
run: |
|
||||
echo "Checking product references in ./pezcumulus..."
|
||||
COUNT=$(find ./pezcumulus -name "*.rs" -type f | head -50 | xargs grep -l "Pezcumulus\|PEZCUMULUS" 2>/dev/null | wc -l || echo 0)
|
||||
echo "Found $COUNT files with Pezcumulus product reference"
|
||||
|
||||
- name: Check the product references in Bizinikiwi
|
||||
run: |
|
||||
echo "Checking product references in ./bizinikiwi..."
|
||||
COUNT=$(find ./bizinikiwi -name "*.rs" -type f | head -50 | xargs grep -l "Bizinikiwi\|BIZINIKIWI" 2>/dev/null | wc -l || echo 0)
|
||||
echo "Found $COUNT files with Bizinikiwi product reference"
|
||||
@@ -1,43 +0,0 @@
|
||||
# DISABLED: External link issues (GitHub rate limiting, third-party sites down)
|
||||
# Re-enable after mainnet launch
|
||||
name: Check links
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Manual trigger only
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
packages: read
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
link-checker:
|
||||
runs-on: ubuntu-latest
|
||||
needs: isdraft
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Restore lychee cache
|
||||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: .lycheecache
|
||||
key: cache-lychee-${{ github.sha }}
|
||||
# This should restore from the most recent one:
|
||||
restore-keys: cache-lychee-
|
||||
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.0 (22. Sep 2023)
|
||||
|
||||
- name: Lychee link checker
|
||||
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # for v1.9.1 (10. Jan 2024)
|
||||
with:
|
||||
args: >-
|
||||
--config .config/lychee.toml
|
||||
--no-progress
|
||||
'./**/*.rs'
|
||||
fail: true
|
||||
env:
|
||||
# To bypass GitHub rate-limit:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
@@ -1,132 +0,0 @@
|
||||
name: Short benchmarks (pezframe-omni-bencher)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
ARTIFACTS_NAME: pezframe-omni-bencher-artifacts
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
quick-benchmarks-omni:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_BENCHMARK }}
|
||||
needs: [preflight]
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
env:
|
||||
RUSTFLAGS: "-C debug-assertions"
|
||||
RUST_BACKTRACE: "full"
|
||||
WASM_BUILD_NO_COLOR: 1
|
||||
WASM_BUILD_RUSTFLAGS: "-C debug-assertions"
|
||||
RUST_LOG: "frame_omni_bencher=info,pezkuwi_sdk_frame=info"
|
||||
timeout-minutes: 60
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
|
||||
- name: Clean cargo cache to free disk space
|
||||
run: |
|
||||
cargo clean 2>/dev/null || true
|
||||
rm -rf ~/.cargo/registry/cache 2>/dev/null || true
|
||||
rm -rf ~/.cargo/git/db 2>/dev/null || true
|
||||
|
||||
- name: script
|
||||
id: required
|
||||
run: |
|
||||
cargo build --locked --quiet --release -p asset-hub-zagros-runtime --features runtime-benchmarks
|
||||
cargo run --locked --release -p pezframe-omni-bencher --quiet -- v1 benchmark pezpallet --runtime target/release/wbuild/asset-hub-zagros-runtime/asset_hub_zagros_runtime.compact.compressed.wasm --all --steps 2 --repeat 1 --quiet
|
||||
|
||||
runtime-matrix:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [preflight]
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
timeout-minutes: 30
|
||||
outputs:
|
||||
runtime: ${{ steps.runtime.outputs.runtime }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
name: Extract runtimes from matrix
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- id: runtime
|
||||
run: |
|
||||
RUNTIMES=$(jq '[.[] | select(.package != null)]' .github/workflows/runtimes-matrix.json)
|
||||
|
||||
RUNTIMES=$(echo $RUNTIMES | jq -c .)
|
||||
echo "runtime=$RUNTIMES"
|
||||
echo "runtime=$RUNTIMES" >> $GITHUB_OUTPUT
|
||||
|
||||
run-pezframe-omni-bencher:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_BENCHMARK }}
|
||||
needs: [preflight, runtime-matrix]
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false # keep running other workflows even if one fails, to see the logs of all possible failures
|
||||
matrix:
|
||||
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
|
||||
bench_cmd: ["pallet", "overhead"]
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
PACKAGE_NAME: ${{ matrix.runtime.package }}
|
||||
FLAGS: ${{ matrix.runtime.bench_flags }}
|
||||
RUST_LOG: "frame_omni_bencher=info,pezkuwi_sdk_frame=info"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
|
||||
- name: script (benchmark ${{ matrix.bench_cmd }})
|
||||
id: required
|
||||
shell: bash
|
||||
run: |
|
||||
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm
|
||||
RUNTIME_BLOB_PATH=./target/release/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME
|
||||
BENCH_CMD=${{ matrix.bench_cmd }}
|
||||
cargo build --release --locked -p $PACKAGE_NAME -p pezframe-omni-bencher --features=${{ matrix.runtime.bench_features }} --quiet
|
||||
echo "Running short $BENCH_CMD benchmarking for PACKAGE_NAME=$PACKAGE_NAME and RUNTIME_BLOB_PATH=$RUNTIME_BLOB_PATH"
|
||||
ls -lrt $RUNTIME_BLOB_PATH
|
||||
|
||||
if [[ "$BENCH_CMD" == "pallet" ]]; then
|
||||
cmd="./target/release/pezframe-omni-bencher v1 benchmark pezpallet --runtime $RUNTIME_BLOB_PATH --all --steps 2 --repeat 1 $FLAGS"
|
||||
elif [[ "$BENCH_CMD" == "overhead" ]]; then
|
||||
cmd="./target/release/pezframe-omni-bencher v1 benchmark overhead --runtime $RUNTIME_BLOB_PATH"
|
||||
else
|
||||
echo "Error: Unknown BENCH_CMD value: $BENCH_CMD"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Running command: $cmd"
|
||||
eval "$cmd"
|
||||
|
||||
confirm-pezframe-omni-benchers-passed:
|
||||
runs-on: ubuntu-latest
|
||||
name: All benchmarks passed
|
||||
needs: [quick-benchmarks-omni, run-pezframe-omni-bencher]
|
||||
if: always() && !cancelled()
|
||||
steps:
|
||||
- run: |
|
||||
tee resultfile <<< '${{ toJSON(needs) }}'
|
||||
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
|
||||
if [ $FAILURES -gt 0 ]; then
|
||||
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
@@ -1,108 +0,0 @@
|
||||
name: check-runtime-compatibility
|
||||
|
||||
# DISABLED: Pezkuwi does not have public RPC endpoints yet.
|
||||
# Re-enable when public nodes are available at pezkuwichain.io
|
||||
# To enable: remove 'if: false' from the job below
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
merge_group:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
check-runtime-compatibility:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
# DISABLED until Pezkuwi public RPC endpoints are available
|
||||
if: false # ${{ needs.preflight.outputs.changes_rust }}
|
||||
timeout-minutes: 30
|
||||
needs: [preflight]
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
network:
|
||||
[
|
||||
zagros,
|
||||
asset-hub-zagros,
|
||||
bridge-hub-zagros,
|
||||
collectives-zagros,
|
||||
coretime-zagros,
|
||||
]
|
||||
include:
|
||||
- network: zagros
|
||||
package: zagros-runtime
|
||||
wasm: zagros_runtime.compact.compressed.wasm
|
||||
uri: "wss://try-runtime-zagros.pezkuwichain.io:443"
|
||||
- network: asset-hub-zagros
|
||||
package: asset-hub-zagros-runtime
|
||||
wasm: asset_hub_zagros_runtime.compact.compressed.wasm
|
||||
uri: "wss://zagros-asset-hub-rpc.pezkuwichain.io:443"
|
||||
- network: bridge-hub-zagros
|
||||
package: bridge-hub-zagros-runtime
|
||||
wasm: bridge_hub_zagros_runtime.compact.compressed.wasm
|
||||
uri: "wss://zagros-bridge-hub-rpc.pezkuwichain.io:443"
|
||||
- network: collectives-zagros
|
||||
package: collectives-zagros-runtime
|
||||
wasm: collectives_zagros_runtime.compact.compressed.wasm
|
||||
uri: "wss://zagros-collectives-rpc.pezkuwichain.io:443"
|
||||
- network: coretime-zagros
|
||||
package: coretime-zagros-runtime
|
||||
wasm: coretime_zagros_runtime.compact.compressed.wasm
|
||||
uri: "wss://zagros-coretime-rpc.pezkuwichain.io:443"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Build Runtime
|
||||
id: build-runtime
|
||||
run: |
|
||||
echo "---------- Building ${{ matrix.package }} runtime with on-chain-release-build ----------"
|
||||
cargo build --release --locked -p ${{ matrix.package }} --features on-chain-release-build -q
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
with:
|
||||
node-version: "24.x"
|
||||
registry-url: "https://npm.pkg.github.com"
|
||||
|
||||
- name: Check Runtime Compatibility
|
||||
id: check-compatibility
|
||||
run: |
|
||||
echo "---------- Checking runtime compatibility for ${{ matrix.network }} ----------"
|
||||
npx @pezkuwi-api/check-runtime@latest problems ${{ matrix.uri }} --wasm ./target/release/wbuild/${{ matrix.package }}/${{ matrix.wasm }}
|
||||
|
||||
|
||||
# name of this job must be unique across all workflows
|
||||
# otherwise GitHub will mark all these jobs as required
|
||||
confirm-runtime-compatibility-checks-passed:
|
||||
runs-on: ubuntu-latest
|
||||
name: All runtime compatibility checks passed
|
||||
needs: [check-runtime-compatibility]
|
||||
if: always() && !cancelled()
|
||||
steps:
|
||||
- run: |
|
||||
tee resultfile <<< '${{ toJSON(needs) }}'
|
||||
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
|
||||
if [ $FAILURES -gt 0 ]; then
|
||||
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
@@ -1,150 +0,0 @@
|
||||
name: check-runtime-migration
|
||||
|
||||
# DISABLED: Pezkuwi does not have public RPC endpoints yet.
|
||||
# Re-enable when public nodes are available at pezkuwichain.io
|
||||
# To enable: remove 'if: false' from the job below
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
# Take a snapshot at 5am when most SDK devs are not working.
|
||||
schedule:
|
||||
- cron: "0 5 * * *"
|
||||
merge_group:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
# More info can be found here: https://github.com/pezkuwichain/pezkuwi-sdk/pull/5865
|
||||
check-runtime-migration:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
# DISABLED until Pezkuwi public RPC endpoints are available
|
||||
if: false # ${{ needs.preflight.outputs.changes_rust }}
|
||||
# We need to set this to rather long to allow the snapshot to be created, but the average time
|
||||
# should be much lower.
|
||||
timeout-minutes: 60
|
||||
needs: [preflight]
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
network:
|
||||
[
|
||||
zagros,
|
||||
asset-hub-zagros,
|
||||
bridge-hub-zagros,
|
||||
collectives-zagros,
|
||||
coretime-zagros,
|
||||
]
|
||||
include:
|
||||
- network: zagros
|
||||
package: zagros-runtime
|
||||
wasm: zagros_runtime.compact.compressed.wasm
|
||||
uri: "wss://try-runtime-zagros.pezkuwichain.io:443"
|
||||
subcommand_extra_args: "--no-weight-warnings --blocktime 6000"
|
||||
command_extra_args: ""
|
||||
- network: asset-hub-zagros
|
||||
package: asset-hub-zagros-runtime
|
||||
wasm: asset_hub_zagros_runtime.compact.compressed.wasm
|
||||
uri: "wss://zagros-asset-hub-rpc.pezkuwichain.io:443"
|
||||
subcommand_extra_args: " --blocktime 6000"
|
||||
command_extra_args: ""
|
||||
- network: bridge-hub-zagros
|
||||
package: bridge-hub-zagros-runtime
|
||||
wasm: bridge_hub_zagros_runtime.compact.compressed.wasm
|
||||
uri: "wss://zagros-bridge-hub-rpc.pezkuwichain.io:443"
|
||||
subcommand_extra_args: " --blocktime 6000"
|
||||
- network: collectives-zagros
|
||||
package: collectives-zagros-runtime
|
||||
wasm: collectives_zagros_runtime.compact.compressed.wasm
|
||||
uri: "wss://zagros-collectives-rpc.pezkuwichain.io:443"
|
||||
command_extra_args: "--disable-spec-name-check"
|
||||
subcommand_extra_args: " --blocktime 6000"
|
||||
- network: coretime-zagros
|
||||
package: coretime-zagros-runtime
|
||||
wasm: coretime_zagros_runtime.compact.compressed.wasm
|
||||
uri: "wss://zagros-coretime-rpc.pezkuwichain.io:443"
|
||||
subcommand_extra_args: " --blocktime 6000"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Download CLI
|
||||
# NOTE: try-runtime-cli is an upstream shared tool from paritytech/try-runtime-cli
|
||||
run: |
|
||||
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.8.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime
|
||||
chmod +x ./try-runtime
|
||||
echo "Using try-runtime-cli version:"
|
||||
./try-runtime --version
|
||||
|
||||
- name: Get Date
|
||||
id: get-date
|
||||
run: |
|
||||
echo "today=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
- name: Download Snapshot
|
||||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: snapshot.raw
|
||||
key: try-runtime-snapshot-${{ matrix.network }}-${{ steps.get-date.outputs.today }}
|
||||
save-always: true
|
||||
|
||||
- name: Create Snapshot If Stale
|
||||
if: ${{ hashFiles('snapshot.raw') == '' }}
|
||||
run: |
|
||||
echo "Creating new snapshot for today (${{ steps.get-date.outputs.today }})"
|
||||
./try-runtime create-snapshot --uri ${{ matrix.uri }} snapshot.raw
|
||||
|
||||
- name: Build Runtime
|
||||
id: required1
|
||||
run: |
|
||||
echo "---------- Building ${{ matrix.package }} runtime ----------"
|
||||
cargo build --release --locked -p ${{ matrix.package }} --features try-runtime -q
|
||||
|
||||
- name: Run Check
|
||||
id: required2
|
||||
run: |
|
||||
echo "Running ${{ matrix.network }} runtime migration check"
|
||||
export RUST_LOG=remote-ext=debug,runtime=debug
|
||||
|
||||
echo "---------- Executing on-runtime-upgrade for ${{ matrix.network }} ----------"
|
||||
./try-runtime ${{ matrix.command_extra_args }} \
|
||||
--runtime ./target/release/wbuild/${{ matrix.package }}/${{ matrix.wasm }} \
|
||||
on-runtime-upgrade --disable-spec-version-check --checks=all ${{ matrix.subcommand_extra_args }} snap -p snapshot.raw
|
||||
sleep 5
|
||||
|
||||
|
||||
# name of this job must be unique across all workflows
|
||||
# otherwise GitHub will mark all these jobs as required
|
||||
confirm-required-checks-passed:
|
||||
runs-on: ubuntu-latest
|
||||
name: All runtime migrations passed
|
||||
# If any new job gets added, be sure to add it to this array
|
||||
needs: [check-runtime-migration]
|
||||
if: always() && !cancelled()
|
||||
steps:
|
||||
- run: |
|
||||
tee resultfile <<< '${{ toJSON(needs) }}'
|
||||
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
|
||||
if [ $FAILURES -gt 0 ]; then
|
||||
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
@@ -0,0 +1,84 @@
|
||||
name: check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
CARGO_INCREMENTAL: "0"
|
||||
|
||||
jobs:
|
||||
# Compliance is cheap and must always hold.
|
||||
compliance:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Ensure license & attribution files present
|
||||
run: |
|
||||
set -e
|
||||
test -f NOTICE
|
||||
test -f LICENSE-APACHE
|
||||
test -f LICENSE-GPL3
|
||||
echo "compliance files present"
|
||||
|
||||
fmt:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: rustfmt
|
||||
run: |
|
||||
rustup component add rustfmt
|
||||
cargo fmt --all --check
|
||||
|
||||
# Build the runtimes (the on-chain deliverable). This is the gating job.
|
||||
# Heavy zombienet / emulated integration suites are intentionally NOT run here;
|
||||
# they are available in-tree and run on demand, not on every push.
|
||||
runtimes:
|
||||
# Self-hosted runner (dedicated, isolated box). For security on a public repo,
|
||||
# this heavy job runs ONLY on push to a branch in this repo or on PRs that
|
||||
# originate from this repo — never on pull requests from forks, so untrusted
|
||||
# code cannot execute on the runner.
|
||||
if: >-
|
||||
github.event_name == 'push' ||
|
||||
github.event.pull_request.head.repo.full_name == github.repository
|
||||
runs-on: [self-hosted, substrate-build]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Toolchain & targets
|
||||
run: |
|
||||
rustup show
|
||||
rustup component add rust-src
|
||||
rustup target add wasm32v1-none wasm32-unknown-unknown
|
||||
- name: Build runtime WASM (check)
|
||||
run: |
|
||||
cargo check --locked \
|
||||
-p pezkuwichain-runtime \
|
||||
-p zagros-runtime \
|
||||
-p asset-hub-pezkuwichain-runtime \
|
||||
-p asset-hub-zagros-runtime \
|
||||
-p people-pezkuwichain-runtime \
|
||||
-p people-zagros-runtime
|
||||
|
||||
# The runtimes must also build with the try-runtime feature — this is what makes
|
||||
# safe storage migrations possible, a fund-critical gate before any upgrade. It is
|
||||
# light (-p runtimes only), so it stays on the every-push fast path. The heavy
|
||||
# full-workspace suites (tests, clippy, benches, doc-tests) run nightly in test.yml.
|
||||
check-try-runtime:
|
||||
if: >-
|
||||
github.event_name == 'push' ||
|
||||
github.event.pull_request.head.repo.full_name == github.repository
|
||||
runs-on: [self-hosted, substrate-build]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- run: |
|
||||
cargo check --locked --features try-runtime \
|
||||
-p pezkuwichain-runtime -p zagros-runtime \
|
||||
-p asset-hub-pezkuwichain-runtime -p asset-hub-zagros-runtime \
|
||||
-p people-pezkuwichain-runtime -p people-zagros-runtime
|
||||
@@ -1,252 +0,0 @@
|
||||
# Checks that doesn't require heavy lifting, like formatting, linting, etc.
|
||||
name: quick-checks
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
merge_group:
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
fmt:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
needs: [preflight]
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
- name: Cargo fmt
|
||||
id: required
|
||||
run: cargo fmt --all -- --check
|
||||
check-dependency-rules:
|
||||
runs-on: ubuntu-latest
|
||||
needs: isdraft
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
- name: check dependency rules
|
||||
run: |
|
||||
cd bizinikiwi/
|
||||
../.gitlab/ensure-deps.sh
|
||||
check-zepter:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
needs: [preflight]
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
- name: fetch deps
|
||||
run: |
|
||||
# Pull all dependencies eagerly:
|
||||
time cargo metadata --format-version=1 --locked > /dev/null
|
||||
- name: Install newer Zepter
|
||||
run: |
|
||||
cargo install zepter@1.82.1 --locked -q
|
||||
- name: run zepter
|
||||
run: |
|
||||
zepter --version
|
||||
time zepter run check
|
||||
test-rust-features:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
needs: [preflight]
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
- name: run rust features
|
||||
run: bash .gitlab/rust-features.sh .
|
||||
check-toml-format:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
needs: [preflight]
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
- name: check toml format
|
||||
run: |
|
||||
taplo format --check --config .config/taplo.toml
|
||||
echo "Please run `taplo format --config .config/taplo.toml` to fix any toml formatting issues"
|
||||
check-workspace:
|
||||
runs-on: ubuntu-latest
|
||||
needs: isdraft
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.0 (22. Sep 2023)
|
||||
- name: install python deps
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y python3-pip python3
|
||||
pip3 install toml "cargo-workspace>=1.2.6"
|
||||
- name: check integrity
|
||||
run: >
|
||||
python3 .github/scripts/check-workspace.py .
|
||||
--exclude
|
||||
"bizinikiwi/pezframe/contracts/fixtures/build"
|
||||
"bizinikiwi/pezframe/contracts/fixtures/contracts/common"
|
||||
- name: deny git deps
|
||||
run: python3 .github/scripts/deny-git-deps.py .
|
||||
check-markdown:
|
||||
runs-on: ubuntu-latest
|
||||
needs: isdraft
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
with:
|
||||
node-version: "18.x"
|
||||
- name: Install tooling
|
||||
run: |
|
||||
npm install -g markdownlint-cli
|
||||
markdownlint --version
|
||||
- name: Check Markdown
|
||||
env:
|
||||
CONFIG: .github/.markdownlint.yaml
|
||||
run: |
|
||||
echo "Checking markdown formatting. More info: docs/contributor/markdown_linting.md"
|
||||
echo "To fix potential errors, you can run 'markdownlint --config .github/.markdownlint.yaml -f --ignore target --ignore vendor .' locally."
|
||||
markdownlint --config "$CONFIG" --ignore target --ignore vendor .
|
||||
check-umbrella:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
needs: [preflight]
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.0 (22. Sep 2023)
|
||||
- name: install python deps
|
||||
run: pip3 install "cargo-workspace>=1.2.4" toml
|
||||
- name: Install newer Zepter
|
||||
run: |
|
||||
cargo install zepter@1.82.1 --locked -q && zepter --version
|
||||
- name: check umbrella correctness
|
||||
run: |
|
||||
# Fixes "detected dubious ownership" error in the ci
|
||||
git config --global --add safe.directory '*'
|
||||
|
||||
# Ensure jq is installed
|
||||
if ! command -v jq &> /dev/null; then
|
||||
echo "Installing jq..."
|
||||
apt-get update && apt-get install -y jq
|
||||
fi
|
||||
|
||||
# Extract the umbrella crate version dynamically from cargo metadata
|
||||
UMBRELLA_VERSION=$(cargo metadata --format-version=1 | jq -r '.packages[] | select(.manifest_path | endswith("umbrella/Cargo.toml")) | .version')
|
||||
|
||||
if [ -z "$UMBRELLA_VERSION" ]; then
|
||||
echo "Warning: Could not determine umbrella version from cargo metadata, using fallback version 0.1.0"
|
||||
UMBRELLA_VERSION="0.1.0"
|
||||
fi
|
||||
|
||||
echo "Using umbrella crate version: $UMBRELLA_VERSION"
|
||||
|
||||
python3 scripts/generate-umbrella.py --sdk . --version "$UMBRELLA_VERSION"
|
||||
|
||||
cargo +nightly fmt -p pezkuwi-sdk
|
||||
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
cat <<EOF
|
||||
👋 Hello developer! Apparently you added a new crate that is not part of the umbrella crate?
|
||||
|
||||
You can just apply the patch (git apply PATCH_NAME) that was printed to make this CI check succeed.
|
||||
|
||||
Otherwise feel free to ask in the Merge Request or in Matrix chat.
|
||||
EOF
|
||||
|
||||
git diff
|
||||
exit 1
|
||||
fi
|
||||
check-fail-ci:
|
||||
runs-on: ubuntu-latest
|
||||
needs: isdraft
|
||||
steps:
|
||||
- name: Fetch latest code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Install ripgrep
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y ripgrep
|
||||
- name: Check
|
||||
run: |
|
||||
set +e
|
||||
rg --line-number --hidden --type rust --glob '!{.git,target}' "$ASSERT_REGEX" .; exit_status=$?
|
||||
if [ $exit_status -eq 0 ]; then
|
||||
echo "$ASSERT_REGEX was found, exiting with 1";
|
||||
exit 1;
|
||||
else
|
||||
echo "No $ASSERT_REGEX was found, exiting with 0";
|
||||
exit 0;
|
||||
fi
|
||||
env:
|
||||
ASSERT_REGEX: "FAIL-CI"
|
||||
GIT_DEPTH: 1
|
||||
check-readme:
|
||||
runs-on: ubuntu-latest
|
||||
needs: isdraft
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Install prerequisites
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y protobuf-compiler
|
||||
|
||||
- name: Set rust version from env file
|
||||
run: |
|
||||
RUST_VERSION=$(cat .github/env | sed -E 's/.*ci-unified:([^-]+)-([^-]+).*/\2/')
|
||||
echo $RUST_VERSION
|
||||
echo "RUST_VERSION=${RUST_VERSION}" >> $GITHUB_ENV
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@a0b538fa0b742a6aa35d6e2c169b4bd06d225a98 # v1.15.3
|
||||
with:
|
||||
cache: false
|
||||
toolchain: ${{ env.RUST_VERSION }}
|
||||
components: cargo, clippy, rust-docs, rust-src, rustfmt, rustc, rust-std
|
||||
|
||||
- name: Find README.docify.md files and check generated READMEs
|
||||
run: .github/scripts/check-missing-readme-generation.sh
|
||||
|
||||
confirm-required-checks-quick-jobs-passed:
|
||||
runs-on: ubuntu-latest
|
||||
name: All quick checks passed
|
||||
# If any new job gets added, be sure to add it to this array
|
||||
needs:
|
||||
- fmt
|
||||
- check-dependency-rules
|
||||
- check-zepter
|
||||
- test-rust-features
|
||||
- check-toml-format
|
||||
- check-workspace
|
||||
- check-markdown
|
||||
- check-umbrella
|
||||
- check-fail-ci
|
||||
- check-readme
|
||||
if: always() && !cancelled()
|
||||
steps:
|
||||
- run: |
|
||||
tee resultfile <<< '${{ toJSON(needs) }}'
|
||||
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
|
||||
if [ $FAILURES -gt 0 ]; then
|
||||
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
@@ -1,136 +0,0 @@
|
||||
name: Checks
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
merge_group:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
cargo-clippy:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
needs: [preflight]
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
timeout-minutes: 90
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
volumes:
|
||||
- /cache/cargo-target/pezkuwi-sdk:/cache/target
|
||||
env:
|
||||
RUSTFLAGS: "-D warnings"
|
||||
SKIP_WASM_BUILD: 1
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_TARGET_DIR: /cache/target
|
||||
WASM_BUILD_WORKSPACE_HINT: ${{ github.workspace }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
|
||||
with:
|
||||
shared-key: clippy
|
||||
cache-on-failure: true
|
||||
|
||||
- name: script
|
||||
id: required
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
cargo clippy --all-targets --all-features --locked --workspace --quiet \
|
||||
--exclude pezpallet-revive-eth-rpc \
|
||||
--exclude pezkuwi-zombienet-sdk-tests
|
||||
|
||||
check-try-runtime:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
needs: [preflight, cargo-clippy]
|
||||
if: ${{ always() && !cancelled() && needs.preflight.outputs.changes_rust }}
|
||||
timeout-minutes: 90
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
volumes:
|
||||
- /cache/cargo-target/pezkuwi-sdk:/cache/target
|
||||
env:
|
||||
SKIP_WASM_BUILD: 1
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_TARGET_DIR: /cache/target
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
|
||||
with:
|
||||
shared-key: try-runtime
|
||||
cache-on-failure: true
|
||||
|
||||
- name: script
|
||||
id: required
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
cargo check --locked --all --features try-runtime --quiet
|
||||
# Check that teyrchain-template will compile with `try-runtime` feature flag.
|
||||
cargo check --locked -p teyrchain-template-node --features try-runtime
|
||||
# experimental code may rely on try-runtime and vice-versa
|
||||
cargo check --locked --all --features try-runtime,experimental --quiet
|
||||
|
||||
check-core-crypto-features:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
needs: [preflight]
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
|
||||
- name: script
|
||||
id: required
|
||||
run: |
|
||||
cd bizinikiwi/primitives/core
|
||||
./check-features-variants.sh
|
||||
cd -
|
||||
cd bizinikiwi/primitives/application-crypto
|
||||
./check-features-variants.sh
|
||||
cd -
|
||||
cd bizinikiwi/primitives/keyring
|
||||
./check-features-variants.sh
|
||||
cd -
|
||||
# name of this job must be unique across all workflows
|
||||
# otherwise GitHub will mark all these jobs as required
|
||||
confirm-required-checks-passed:
|
||||
runs-on: ubuntu-latest
|
||||
name: All checks passed
|
||||
# If any new job gets added, be sure to add it to this array
|
||||
needs: [cargo-clippy, check-try-runtime, check-core-crypto-features]
|
||||
if: always() && !cancelled()
|
||||
steps:
|
||||
- run: |
|
||||
tee resultfile <<< '${{ toJSON(needs) }}'
|
||||
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
|
||||
if [ $FAILURES -gt 0 ]; then
|
||||
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
@@ -1,507 +0,0 @@
|
||||
name: Command - Run
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
cmd:
|
||||
description: "Command to run"
|
||||
required: true
|
||||
pr_num:
|
||||
description: "PR number"
|
||||
required: true
|
||||
pr_branch:
|
||||
description: "PR branch"
|
||||
required: true
|
||||
runner:
|
||||
description: "Runner to use"
|
||||
required: true
|
||||
image:
|
||||
description: "Image to use"
|
||||
required: true
|
||||
is_org_member:
|
||||
description: "Is the user an org member"
|
||||
required: true
|
||||
is_pr_author:
|
||||
description: "Is the user the PR author"
|
||||
required: true
|
||||
repo:
|
||||
description: "Repository to use"
|
||||
required: true
|
||||
comment_id:
|
||||
description: "Comment ID"
|
||||
required: true
|
||||
is_quiet:
|
||||
description: "Quiet mode"
|
||||
required: false
|
||||
default: "false"
|
||||
|
||||
permissions: # allow the action to comment on the PR
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: write
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
before-cmd:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JOB_NAME: "cmd"
|
||||
CMD: ${{ github.event.inputs.cmd }}
|
||||
PR_BRANCH: ${{ github.event.inputs.pr_branch }}
|
||||
PR_NUM: ${{ github.event.inputs.pr_num }}
|
||||
outputs:
|
||||
job_url: ${{ steps.build-link.outputs.job_url }}
|
||||
run_url: ${{ steps.build-link.outputs.run_url }}
|
||||
steps:
|
||||
- name: Build workflow link
|
||||
if: ${{ github.event.inputs.is_quiet == 'false' }}
|
||||
id: build-link
|
||||
run: |
|
||||
# Get exactly the CMD job link, filtering out the other jobs
|
||||
jobLink=$(curl -s \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq '.jobs[] | select(.name | contains("${{ env.JOB_NAME }}")) | .html_url')
|
||||
|
||||
runLink=$(curl -s \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }} | jq '.html_url')
|
||||
|
||||
echo "job_url=${jobLink}"
|
||||
echo "run_url=${runLink}"
|
||||
echo "job_url=$jobLink" >> $GITHUB_OUTPUT
|
||||
echo "run_url=$runLink" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Comment PR (Start)
|
||||
# No need to comment on prdoc start or if --quiet
|
||||
if: ${{ github.event.inputs.is_quiet == 'false' && !startsWith(github.event.inputs.cmd, 'prdoc') && !startsWith(github.event.inputs.cmd, 'fmt') && !startsWith(github.event.inputs.cmd, 'label')}}
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
let job_url = ${{ steps.build-link.outputs.job_url }}
|
||||
let cmd = process.env.CMD;
|
||||
github.rest.issues.createComment({
|
||||
issue_number: ${{ env.PR_NUM }},
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `Command "${cmd}" has started 🚀 [See logs here](${job_url})`
|
||||
})
|
||||
|
||||
- name: Debug info
|
||||
env:
|
||||
CMD: ${{ github.event.inputs.cmd }}
|
||||
PR_BRANCH: ${{ github.event.inputs.pr_branch }}
|
||||
PR_NUM: ${{ github.event.inputs.pr_num }}
|
||||
RUNNER: ${{ github.event.inputs.runner }}
|
||||
IMAGE: ${{ github.event.inputs.image }}
|
||||
IS_ORG_MEMBER: ${{ github.event.inputs.is_org_member }}
|
||||
REPO: ${{ github.event.inputs.repo }}
|
||||
COMMENT_ID: ${{ github.event.inputs.comment_id }}
|
||||
IS_QUIET: ${{ github.event.inputs.is_quiet }}
|
||||
run: |
|
||||
echo "Running command: $CMD"
|
||||
echo "PR number: $PR_NUM"
|
||||
echo "PR branch: $PR_BRANCH"
|
||||
echo "Runner: $RUNNER"
|
||||
echo "Image: $IMAGE"
|
||||
echo "Is org member: $IS_ORG_MEMBER"
|
||||
echo "Repository: $REPO"
|
||||
echo "Comment ID: $COMMENT_ID"
|
||||
echo "Is quiet: $IS_QUIET"
|
||||
|
||||
cmd:
|
||||
needs: [before-cmd]
|
||||
env:
|
||||
CMD: ${{ github.event.inputs.cmd }}
|
||||
PR_BRANCH: ${{ github.event.inputs.pr_branch }}
|
||||
PR_NUM: ${{ github.event.inputs.pr_num }}
|
||||
REPO: ${{ github.event.inputs.repo }}
|
||||
runs-on: ${{ github.event.inputs.runner }}
|
||||
container:
|
||||
image: ${{ github.event.inputs.image }}
|
||||
timeout-minutes: 1440 # 24 hours per runtime
|
||||
# lowerdown permissions to separate permissions context for executable parts by contributors
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: none
|
||||
actions: none
|
||||
issues: none
|
||||
outputs:
|
||||
cmd_output: ${{ steps.cmd.outputs.cmd_output }}
|
||||
subweight: ${{ steps.subweight.outputs.result }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
repository: ${{ env.REPO }}
|
||||
ref: ${{ env.PR_BRANCH }}
|
||||
|
||||
# In order to run prdoc without specifying the PR number, we need to add the PR number as an argument automatically
|
||||
- name: Prepare PR Number argument
|
||||
id: pr-arg
|
||||
run: |
|
||||
CMD="${CMD}"
|
||||
if echo "$CMD" | grep -q "prdoc" && ! echo "$CMD" | grep -qE "\-\-pr[[:space:]=][0-9]+"; then
|
||||
echo "arg=--pr ${PR_NUM}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "arg=" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Run cmd
|
||||
id: cmd
|
||||
env:
|
||||
PR_ARG: ${{ steps.pr-arg.outputs.arg }}
|
||||
IS_ORG_MEMBER: ${{ github.event.inputs.is_org_member }}
|
||||
IS_PR_AUTHOR: ${{ github.event.inputs.is_pr_author }}
|
||||
RUNNER: ${{ github.event.inputs.runner }}
|
||||
IMAGE: ${{ github.event.inputs.image }}
|
||||
run: |
|
||||
echo "Running command: '${CMD} ${PR_ARG}' on '${RUNNER}' runner, container: '${IMAGE}'"
|
||||
echo "RUST_NIGHTLY_VERSION: ${RUST_NIGHTLY_VERSION}"
|
||||
echo "IS_ORG_MEMBER: ${IS_ORG_MEMBER}"
|
||||
|
||||
git config --global --add safe.directory $GITHUB_WORKSPACE
|
||||
git config user.name "cmd[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
# if the user is not an org member, we need to use the bot's path from master to avoid unwanted modifications
|
||||
if [ "${IS_ORG_MEMBER}" = "true" ]; then
|
||||
# safe to run commands from current branch
|
||||
BOT_PATH=.github
|
||||
else
|
||||
# going to run commands from master
|
||||
TMP_DIR=/tmp/pezkuwi-sdk
|
||||
git clone --depth 1 --branch master https://github.com/pezkuwichain/pezkuwi-sdk $TMP_DIR
|
||||
BOT_PATH=$TMP_DIR/.github
|
||||
fi
|
||||
|
||||
# install deps and run a command from master
|
||||
python3 -m pip install -r $BOT_PATH/scripts/generate-prdoc.requirements.txt
|
||||
python3 $BOT_PATH/scripts/cmd/cmd.py $CMD $PR_ARG
|
||||
git status > /tmp/cmd/git_status.log
|
||||
git diff > /tmp/cmd/git_diff.log
|
||||
|
||||
if [ -f /tmp/cmd/command_output.log ]; then
|
||||
CMD_OUTPUT=$(cat /tmp/cmd/command_output.log)
|
||||
# export to summary to display in the PR
|
||||
echo "$CMD_OUTPUT" >> $GITHUB_STEP_SUMMARY
|
||||
# should be multiline, otherwise it captures the first line only
|
||||
echo 'cmd_output<<EOF' >> $GITHUB_OUTPUT
|
||||
echo "$CMD_OUTPUT" >> $GITHUB_OUTPUT
|
||||
echo 'EOF' >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
git add -A
|
||||
git diff HEAD > /tmp/cmd/command_diff.patch -U0
|
||||
git commit -m "tmp cmd: $CMD" || true
|
||||
# without push, as we're saving the diff to an artifact and subweight will compare the local branch with the remote branch
|
||||
|
||||
- name: Upload command output
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: command-output
|
||||
path: /tmp/cmd/command_output.log
|
||||
|
||||
- name: Upload command diff
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: command-diff
|
||||
path: /tmp/cmd/command_diff.patch
|
||||
|
||||
- name: Upload git status
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: git-status
|
||||
path: /tmp/cmd/git_status.log
|
||||
|
||||
- name: Upload git diff
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: git-diff
|
||||
path: /tmp/cmd/git_diff.log
|
||||
|
||||
- name: Install subweight for bench
|
||||
if: startsWith(github.event.inputs.cmd, 'bench')
|
||||
run: cargo install subweight
|
||||
|
||||
- name: Run Subweight for bench
|
||||
id: subweight
|
||||
if: startsWith(github.event.inputs.cmd, 'bench')
|
||||
shell: bash
|
||||
run: |
|
||||
git fetch
|
||||
git remote -v
|
||||
echo $(git log -n 2 --oneline)
|
||||
|
||||
result=$(subweight compare commits \
|
||||
--path-pattern "./**/weights/**/*.rs,./**/weights.rs" \
|
||||
--method asymptotic \
|
||||
--format markdown \
|
||||
--no-color \
|
||||
--change added changed \
|
||||
--ignore-errors \
|
||||
refs/remotes/origin/master $PR_BRANCH)
|
||||
|
||||
echo $result
|
||||
|
||||
echo $result > /tmp/cmd/subweight.log
|
||||
# Though github claims that it supports 1048576 bytes in GITHUB_OUTPUT in fact it only supports ~200000 bytes of a multiline string
|
||||
if [ $(wc -c < "/tmp/cmd/subweight.log") -gt 200000 ]; then
|
||||
echo "Subweight result is too large, truncating..."
|
||||
echo "Please check subweight.log for the full output"
|
||||
result="Please check subweight.log for the full output"
|
||||
fi
|
||||
echo "Trying to save subweight result to GITHUB_OUTPUT"
|
||||
# Save the multiline result to the output
|
||||
{
|
||||
echo "result<<EOF"
|
||||
echo "$result"
|
||||
echo "EOF"
|
||||
} >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Upload Subweight
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
if: startsWith(github.event.inputs.cmd, 'bench')
|
||||
with:
|
||||
name: subweight
|
||||
path: /tmp/cmd/subweight.log
|
||||
|
||||
after-cmd:
|
||||
needs: [cmd, before-cmd]
|
||||
env:
|
||||
CMD: ${{ github.event.inputs.cmd }}
|
||||
PR_BRANCH: ${{ github.event.inputs.pr_branch }}
|
||||
PR_NUM: ${{ github.event.inputs.pr_num }}
|
||||
REPO: ${{ github.event.inputs.repo }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# needs to be able to trigger CI, as default token does not retrigger
|
||||
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
|
||||
id: generate_token
|
||||
with:
|
||||
app-id: ${{ secrets.CMD_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.CMD_BOT_APP_KEY }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
token: ${{ steps.generate_token.outputs.token }}
|
||||
repository: ${{ env.REPO }}
|
||||
ref: ${{ env.PR_BRANCH }}
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: command-diff
|
||||
path: command-diff
|
||||
|
||||
- name: Apply labels for label command
|
||||
if: startsWith(github.event.inputs.cmd, 'label')
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
github-token: ${{ steps.generate_token.outputs.token }}
|
||||
script: |
|
||||
// Read the command output to get validated labels
|
||||
const fs = require('fs');
|
||||
let labels = [];
|
||||
|
||||
try {
|
||||
const output = fs.readFileSync('/tmp/cmd/command_output.log', 'utf8');
|
||||
|
||||
// Parse JSON labels from output - look for "LABELS_JSON: {...}"
|
||||
const jsonMatch = output.match(/LABELS_JSON: (.+)/);
|
||||
if (jsonMatch) {
|
||||
const labelsData = JSON.parse(jsonMatch[1]);
|
||||
labels = labelsData.labels || [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error reading command output: ${error.message}`);
|
||||
throw new Error('Label validation failed. Check the command output for details.');
|
||||
}
|
||||
|
||||
if (labels.length > 0) {
|
||||
try {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: ${{ env.PR_NUM }},
|
||||
labels: labels
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(`Error adding labels: ${error.message}`);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
- name: Comment PR (Label Error)
|
||||
if: ${{ failure() && startsWith(github.event.inputs.cmd, 'label') }}
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
env:
|
||||
CMD_OUTPUT: "${{ needs.cmd.outputs.cmd_output }}"
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
let runUrl = ${{ needs.before-cmd.outputs.run_url }};
|
||||
let cmdOutput = process.env.CMD_OUTPUT || '';
|
||||
|
||||
// Try to parse JSON error for better formatting
|
||||
let errorMessage = 'Label validation failed. Please check the error details below and try again.';
|
||||
let errorDetails = '';
|
||||
|
||||
try {
|
||||
const errorMatch = cmdOutput.match(/ERROR_JSON: (.+)/);
|
||||
if (errorMatch) {
|
||||
const errorData = JSON.parse(errorMatch[1]);
|
||||
errorMessage = errorData.message || errorMessage;
|
||||
errorDetails = errorData.details || '';
|
||||
}
|
||||
} catch (e) {
|
||||
// Fallback to raw output
|
||||
errorDetails = cmdOutput;
|
||||
}
|
||||
|
||||
let cmdOutputCollapsed = errorDetails.trim() !== ''
|
||||
? `<details>\n\n<summary>Error details:</summary>\n\n${errorDetails}\n\n</details>`
|
||||
: '';
|
||||
|
||||
github.rest.issues.createComment({
|
||||
issue_number: ${{ env.PR_NUM }},
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `❌ ${errorMessage}\n\n${cmdOutputCollapsed}\n\n[See full logs here](${runUrl})`
|
||||
})
|
||||
|
||||
- name: Apply & Commit changes
|
||||
if: ${{ !startsWith(github.event.inputs.cmd, 'label') }}
|
||||
run: |
|
||||
ls -lsa .
|
||||
|
||||
git config --global --add safe.directory $GITHUB_WORKSPACE
|
||||
git config user.name "cmd[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git config --global pull.rebase false
|
||||
|
||||
echo "Applying $file"
|
||||
git apply "command-diff/command_diff.patch" --unidiff-zero --allow-empty
|
||||
|
||||
rm -rf command-diff
|
||||
|
||||
git status
|
||||
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
|
||||
git remote -v
|
||||
|
||||
push_changes() {
|
||||
git push origin "HEAD:$PR_BRANCH"
|
||||
}
|
||||
|
||||
git add .
|
||||
git restore --staged Cargo.lock # ignore changes in Cargo.lock
|
||||
git commit -m "Update from ${{ github.actor }} running command '$CMD'" || true
|
||||
|
||||
# Attempt to push changes
|
||||
if ! push_changes; then
|
||||
echo "Push failed, trying to rebase..."
|
||||
git pull --rebase origin $PR_BRANCH
|
||||
# After successful rebase, try pushing again
|
||||
push_changes
|
||||
fi
|
||||
else
|
||||
echo "Nothing to commit";
|
||||
fi
|
||||
|
||||
|
||||
- name: Comment PR (End)
|
||||
# No need to comment on prdoc success or --quiet
|
||||
#TODO: return "&& !contains(github.event.comment.body, '--quiet')"
|
||||
if: ${{ github.event.inputs.is_quiet == 'false' && needs.cmd.result == 'success' && !startsWith(github.event.inputs.cmd, 'prdoc') && !startsWith(github.event.inputs.cmd, 'fmt') && !startsWith(github.event.inputs.cmd, 'label') }}
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
env:
|
||||
SUBWEIGHT: "${{ needs.cmd.outputs.subweight }}"
|
||||
CMD_OUTPUT: "${{ needs.cmd.outputs.cmd_output }}"
|
||||
PR_NUM: ${{ github.event.inputs.pr_num }}
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
let runUrl = ${{ needs.before-cmd.outputs.run_url }};
|
||||
let subweight = process.env.SUBWEIGHT || '';
|
||||
let cmdOutput = process.env.CMD_OUTPUT || '';
|
||||
let cmd = process.env.CMD;
|
||||
console.log(cmdOutput);
|
||||
|
||||
let subweightCollapsed = subweight.trim() !== ''
|
||||
? `<details>\n\n<summary>Subweight results:</summary>\n\n${subweight}\n\n</details>`
|
||||
: '';
|
||||
|
||||
let cmdOutputCollapsed = cmdOutput.trim() !== ''
|
||||
? `<details>\n\n<summary>Command output:</summary>\n\n${cmdOutput}\n\n</details>`
|
||||
: '';
|
||||
|
||||
github.rest.issues.createComment({
|
||||
issue_number: ${{ env.PR_NUM }},
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `Command "${cmd}" has finished ✅ [See logs here](${runUrl})${subweightCollapsed}${cmdOutputCollapsed}`
|
||||
})
|
||||
|
||||
|
||||
finish:
|
||||
needs: [before-cmd, cmd, after-cmd]
|
||||
if: ${{ always() }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CMD_OUTPUT: "${{ needs.cmd.outputs.cmd_output }}"
|
||||
CMD: ${{ github.event.inputs.cmd }}
|
||||
PR_NUM: ${{ github.event.inputs.pr_num }}
|
||||
COMMENT_ID: ${{ github.event.inputs.comment_id }}
|
||||
steps:
|
||||
- name: Comment PR (Failure)
|
||||
if: ${{ needs.cmd.result == 'failure' || needs.after-cmd.result == 'failure' || needs.before-cmd.result == 'failure' }}
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
let jobUrl = ${{ needs.before-cmd.outputs.job_url }};
|
||||
let cmdOutput = process.env.CMD_OUTPUT;
|
||||
let cmd = process.env.CMD;
|
||||
let cmdOutputCollapsed = '';
|
||||
if (cmdOutput && cmdOutput.trim() !== '') {
|
||||
cmdOutputCollapsed = `<details>\n\n<summary>Command output:</summary>\n\n${cmdOutput}\n\n</details>`
|
||||
}
|
||||
|
||||
github.rest.issues.createComment({
|
||||
issue_number: ${{ env.PR_NUM }},
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `Command "${cmd}" has failed ❌! [See logs here](${jobUrl})${cmdOutputCollapsed}`
|
||||
})
|
||||
|
||||
- name: Add 😕 reaction on failure
|
||||
if: ${{ needs.cmd.result == 'failure' || needs.after-cmd.result == 'failure' || needs.before-cmd.result == 'failure' }}
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.rest.reactions.createForIssueComment({
|
||||
comment_id: ${{ env.COMMENT_ID }},
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
content: 'confused'
|
||||
})
|
||||
|
||||
- name: Add 👍 reaction on success
|
||||
if: ${{ needs.cmd.result == 'success' && needs.after-cmd.result == 'success' && needs.before-cmd.result == 'success' }}
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.rest.reactions.createForIssueComment({
|
||||
comment_id: ${{ env.COMMENT_ID }},
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
content: '+1'
|
||||
})
|
||||
@@ -1,22 +0,0 @@
|
||||
name: Command Bot Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
test-cmd-bot:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [isdraft]
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- run: python3 .github/scripts/cmd/test_cmd.py
|
||||
@@ -1,334 +0,0 @@
|
||||
name: Command
|
||||
|
||||
on:
|
||||
issue_comment: # listen for comments on issues
|
||||
types: [created]
|
||||
|
||||
permissions: # allow the action to comment in PR
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: write
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
is-org-member:
|
||||
if: startsWith(github.event.comment.body, '/cmd')
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
member: ${{ steps.is-member.outputs.result }}
|
||||
steps:
|
||||
- name: Generate token
|
||||
id: generate_token
|
||||
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
|
||||
with:
|
||||
app-id: ${{ secrets.CMD_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.CMD_BOT_APP_KEY }}
|
||||
|
||||
- name: Check if user is a member of the organization
|
||||
id: is-member
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
github-token: ${{ steps.generate_token.outputs.token }}
|
||||
result-encoding: string
|
||||
script: |
|
||||
const fs = require("fs");
|
||||
try {
|
||||
const org = '${{ github.event.repository.owner.login }}';
|
||||
const username = '${{ github.event.comment.user.login }}';
|
||||
|
||||
const membership = await github.rest.orgs.checkMembershipForUser({
|
||||
org: org,
|
||||
username: username
|
||||
});
|
||||
|
||||
console.log(membership, membership.status, membership.status === 204);
|
||||
|
||||
if (membership.status === 204) {
|
||||
return 'true';
|
||||
} else {
|
||||
console.log(membership);
|
||||
fs.appendFileSync(process.env["GITHUB_STEP_SUMMARY"], `${membership.data && membership.data.message || 'Unknown error happened, please check logs'}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
||||
return 'false';
|
||||
|
||||
acknowledge:
|
||||
if: ${{ startsWith(github.event.comment.body, '/cmd') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Add reaction to triggered comment
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.rest.reactions.createForIssueComment({
|
||||
comment_id: ${{ github.event.comment.id }},
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
content: 'eyes'
|
||||
})
|
||||
|
||||
clean:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clean previous comments
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
if: ${{ startsWith(github.event.comment.body, '/cmd') && contains(github.event.comment.body, '--clean') }}
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.rest.issues.listComments({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
}).then(comments => {
|
||||
for (let comment of comments.data) {
|
||||
console.log(comment)
|
||||
if (
|
||||
${{ github.event.comment.id }} !== comment.id &&
|
||||
(
|
||||
(
|
||||
(
|
||||
comment.body.startsWith('Command') ||
|
||||
comment.body.startsWith('<details><summary>Command') ||
|
||||
comment.body.startsWith('Sorry, only ')
|
||||
) && comment.user.type === 'Bot'
|
||||
) ||
|
||||
(comment.body.startsWith('/cmd') && comment.user.login === context.actor)
|
||||
)
|
||||
) {
|
||||
github.rest.issues.deleteComment({
|
||||
comment_id: comment.id,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
get-pr-info:
|
||||
if: ${{ startsWith(github.event.comment.body, '/cmd') }}
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
CMD: ${{ steps.get-comment.outputs.group2 }}
|
||||
pr-branch: ${{ steps.get-pr.outputs.pr_branch }}
|
||||
repo: ${{ steps.get-pr.outputs.repo }}
|
||||
steps:
|
||||
- name: Get command
|
||||
uses: actions-ecosystem/action-regex-match@9e6c4fb3d5e898f505be7a1fb6e7b0a278f6665b # v2.0.2
|
||||
id: get-comment
|
||||
with:
|
||||
text: ${{ github.event.comment.body }}
|
||||
regex: "^(\\/cmd )([-\\/\\s\\w.=:]+)$" # see explanation in docs/contributor/commands-readme.md#examples
|
||||
|
||||
# Get PR branch name, because the issue_comment event does not contain the PR branch name
|
||||
- name: Check if the issue is a PR
|
||||
id: check-pr
|
||||
run: |
|
||||
if [ -n "${{ github.event.issue.pull_request.url }}" ]; then
|
||||
echo "This is a pull request comment"
|
||||
else
|
||||
echo "This is not a pull request comment"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Get PR Branch Name and Repo
|
||||
if: steps.check-pr.outcome == 'success'
|
||||
id: get-pr
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
const pr = await github.rest.pulls.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number,
|
||||
});
|
||||
const prBranch = pr.data.head.ref;
|
||||
const repo = pr.data.head.repo.full_name;
|
||||
console.log(prBranch, repo)
|
||||
core.setOutput('pr_branch', prBranch);
|
||||
core.setOutput('repo', repo);
|
||||
|
||||
- name: Use PR Branch Name and Repo
|
||||
env:
|
||||
PR_BRANCH: ${{ steps.get-pr.outputs.pr_branch }}
|
||||
REPO: ${{ steps.get-pr.outputs.repo }}
|
||||
CMD: ${{ steps.get-comment.outputs.group2 }}
|
||||
run: |
|
||||
echo "The PR branch is $PR_BRANCH"
|
||||
echo "The repository is $REPO"
|
||||
echo "The CMD is $CMD"
|
||||
|
||||
help:
|
||||
needs: [clean, get-pr-info]
|
||||
if: ${{ startsWith(github.event.comment.body, '/cmd') && contains(github.event.comment.body, '--help') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Save output of help
|
||||
id: help
|
||||
env:
|
||||
CMD: ${{ needs.get-pr-info.outputs.CMD }} # to avoid "" around the command
|
||||
run: |
|
||||
python3 -m pip install -r .github/scripts/generate-prdoc.requirements.txt
|
||||
echo 'help<<EOF' >> $GITHUB_OUTPUT
|
||||
python3 .github/scripts/cmd/cmd.py $CMD >> $GITHUB_OUTPUT
|
||||
echo 'EOF' >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Comment PR (Help)
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `<details><summary>Command help:</summary>
|
||||
|
||||
\`\`\`
|
||||
${{ steps.help.outputs.help }}
|
||||
\`\`\`
|
||||
|
||||
</details>`
|
||||
})
|
||||
|
||||
- name: Add confused reaction on failure
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.rest.reactions.createForIssueComment({
|
||||
comment_id: ${{ github.event.comment.id }},
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
content: 'confused'
|
||||
})
|
||||
|
||||
- name: Add 👍 reaction on success
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
if: ${{ !failure() }}
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.rest.reactions.createForIssueComment({
|
||||
comment_id: ${{ github.event.comment.id }},
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
content: '+1'
|
||||
})
|
||||
|
||||
set-image:
|
||||
needs: [clean, get-pr-info]
|
||||
if: ${{ startsWith(github.event.comment.body, '/cmd') && !contains(github.event.comment.body, '--help') }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CMD: ${{ needs.get-pr-info.outputs.CMD }}
|
||||
outputs:
|
||||
IMAGE: ${{ steps.set-image.outputs.IMAGE }}
|
||||
RUNNER: ${{ steps.set-image.outputs.RUNNER }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- id: set-image
|
||||
run: |
|
||||
BODY=$(echo "$CMD" | xargs) # remove whitespace
|
||||
IMAGE_OVERRIDE=$(echo $BODY | grep -oe 'docker.io/pezkuwi/ci-unified:.*\s' | xargs)
|
||||
|
||||
cat .github/env >> $GITHUB_OUTPUT
|
||||
|
||||
if [ -n "$IMAGE_OVERRIDE" ]; then
|
||||
IMAGE=$IMAGE_OVERRIDE
|
||||
echo "IMAGE=$IMAGE" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
# Use GitHub-hosted runners for Pezkuwi SDK
|
||||
echo "RUNNER=ubuntu-latest" >> $GITHUB_OUTPUT
|
||||
- name: Print outputs
|
||||
run: |
|
||||
echo "RUNNER=${{ steps.set-image.outputs.RUNNER }}"
|
||||
echo "IMAGE=${{ steps.set-image.outputs.IMAGE }}"
|
||||
|
||||
check-pr-author:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
is_author: ${{ steps.check-author.outputs.result }}
|
||||
steps:
|
||||
- name: Generate token
|
||||
id: generate_token
|
||||
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
|
||||
with:
|
||||
app-id: ${{ secrets.CMD_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.CMD_BOT_APP_KEY }}
|
||||
|
||||
- name: Check if user is PR author
|
||||
id: check-author
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
github-token: ${{ steps.generate_token.outputs.token }}
|
||||
result-encoding: string
|
||||
script: |
|
||||
const commentUser = '${{ github.event.comment.user.login }}';
|
||||
const prNumber = ${{ github.event.issue.number }};
|
||||
|
||||
try {
|
||||
const pr = await github.rest.pulls.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: prNumber
|
||||
});
|
||||
|
||||
const prAuthor = pr.data.user.login;
|
||||
return commentUser === prAuthor ? 'true' : 'false';
|
||||
} catch (error) {
|
||||
console.error('Error checking PR author:', error);
|
||||
return 'false';
|
||||
}
|
||||
|
||||
run-cmd-workflow:
|
||||
needs: [set-image, get-pr-info, is-org-member, check-pr-author]
|
||||
runs-on: ubuntu-latest
|
||||
# don't run on help command
|
||||
if: ${{ startsWith(github.event.comment.body, '/cmd') && !contains(github.event.comment.body, '--help') }}
|
||||
permissions: # run workflow
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: write
|
||||
actions: write
|
||||
env:
|
||||
CMD: ${{ needs.get-pr-info.outputs.CMD }}
|
||||
PR_BRANCH: ${{ needs.get-pr-info.outputs.pr-branch }}
|
||||
RUNNER: ${{ needs.set-image.outputs.RUNNER }}
|
||||
IMAGE: ${{ needs.set-image.outputs.IMAGE }}
|
||||
REPO: ${{ needs.get-pr-info.outputs.repo }}
|
||||
IS_ORG_MEMBER: ${{ needs.is-org-member.outputs.member }}
|
||||
IS_PR_AUTHOR: ${{ needs.check-pr-author.outputs.is_author }}
|
||||
COMMENT_ID: ${{ github.event.comment.id }}
|
||||
PR_NUMBER: ${{ github.event.issue.number }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Start cmd with gh cli
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh workflow run cmd-run.yml \
|
||||
--ref cmd-bot \
|
||||
-f cmd="${CMD}" \
|
||||
-f repo="${REPO}" \
|
||||
-f pr_branch="${PR_BRANCH}" \
|
||||
-f pr_num="${PR_NUMBER}" \
|
||||
-f runner="${RUNNER}" \
|
||||
-f is_org_member="${IS_ORG_MEMBER}" \
|
||||
-f is_pr_author="${IS_PR_AUTHOR}" \
|
||||
-f comment_id="${COMMENT_ID}" \
|
||||
-f image="${IMAGE}" \
|
||||
-f is_quiet="${{ contains(github.event.comment.body, '--quiet') }}"
|
||||
@@ -1,216 +0,0 @@
|
||||
name: Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
merge_group:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
test-doc:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
timeout-minutes: 300
|
||||
needs: [preflight]
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
volumes:
|
||||
- /cache/cargo-target/pezkuwi-sdk-docs:/cache/target
|
||||
env:
|
||||
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_TARGET_DIR: /cache/target
|
||||
WASM_BUILD_WORKSPACE_HINT: ${{ github.workspace }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
|
||||
# Clean stale caches from other workflows that ran on this VPS runner.
|
||||
# Each VPS has limited disk; leftover caches from tests/checks can fill it.
|
||||
- name: Clean stale caches
|
||||
run: |
|
||||
echo "Disk before cleanup:"
|
||||
df -h /cache 2>/dev/null || df -h /
|
||||
for dir in /cache/cargo-target/*/; do
|
||||
[ "$dir" = "/cache/cargo-target/pezkuwi-sdk-docs/" ] && continue
|
||||
echo "Removing stale cache: $dir"
|
||||
rm -rf "$dir"
|
||||
done
|
||||
echo "Disk after cleanup:"
|
||||
df -h /cache 2>/dev/null || df -h /
|
||||
|
||||
# Exclude pezkuwi-zombienet-sdk-tests: its build.rs runs nested cargo build
|
||||
# which doesn't inherit workspace [patch.crates-io] settings, causing
|
||||
# serde_core duplicate lang item error. See: https://github.com/pezkuwichain/pezkuwi-sdk/issues/357
|
||||
- name: script
|
||||
id: required
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
cargo test --doc --workspace --locked --all-features --exclude pezkuwi-zombienet-sdk-tests --exclude pezpallet-revive-eth-rpc
|
||||
|
||||
build-rustdoc:
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
timeout-minutes: 240
|
||||
continue-on-error: true
|
||||
if: ${{ always() && !cancelled() && needs.preflight.outputs.changes_rust }}
|
||||
needs: [preflight, test-doc]
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
volumes:
|
||||
- /cache/cargo-target/pezkuwi-sdk-docs:/cache/target
|
||||
env:
|
||||
SKIP_WASM_BUILD: 1
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_TARGET_DIR: /cache/target
|
||||
RUSTDOCFLAGS: "-Dwarnings --default-theme=ayu --html-in-header ./docs/sdk/assets/header.html --extend-css ./docs/sdk/assets/theme.css --html-after-content ./docs/sdk/assets/after-content.html"
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
# Exclude pezkuwi-zombienet-sdk-tests: nested cargo build in build.rs
|
||||
# doesn't inherit workspace patches. See test-doc job comment.
|
||||
- name: script
|
||||
id: required
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
cargo doc --all-features --workspace --no-deps --locked --exclude pezkuwi-zombienet-sdk-tests --exclude pezpallet-revive-eth-rpc
|
||||
- run: rm -f ${CARGO_TARGET_DIR}/doc/.lock
|
||||
- run: mv ${CARGO_TARGET_DIR}/doc ./crate-docs
|
||||
- name: Inject Simple Analytics script
|
||||
run: |
|
||||
script_content="<script async defer src=\"https://apisa.pezkuwichain.io/latest.js\"></script><noscript><img src=\"https://apisa.pezkuwichain.io/latest.js\" alt=\"\" referrerpolicy=\"no-referrer-when-downgrade\" /></noscript>"
|
||||
docs_dir="./crate-docs"
|
||||
|
||||
inject_simple_analytics() {
|
||||
find "$1" -name '*.html' | xargs -I {} -P "$(nproc)" bash -c 'file="{}"; echo "Adding Simple Analytics script to $file"; sed -i "s|</head>|'"$2"'</head>|" "$file";'
|
||||
}
|
||||
|
||||
inject_simple_analytics "$docs_dir" "$script_content"
|
||||
- run: echo "<meta http-equiv=refresh content=0;url=pezkuwi_sdk_docs/index.html>" > ./crate-docs/index.html
|
||||
- name: Compress docs for upload
|
||||
run: tar czf crate-docs.tar.gz -C . crate-docs/
|
||||
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ github.sha }}-doc
|
||||
path: crate-docs.tar.gz
|
||||
retention-days: 1
|
||||
if-no-files-found: error
|
||||
compression-level: 0
|
||||
|
||||
build-implementers-guide:
|
||||
runs-on: ubuntu-latest
|
||||
needs: isdraft
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Install mdbook
|
||||
run: |
|
||||
cargo install mdbook --version 0.4.35 --locked
|
||||
- run: mdbook build ./pezkuwi/roadmap/implementers-guide
|
||||
- run: mkdir -p artifacts
|
||||
- run: mv pezkuwi/roadmap/implementers-guide/book artifacts/
|
||||
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ github.sha }}-guide
|
||||
path: ./artifacts/
|
||||
retention-days: 1
|
||||
if-no-files-found: error
|
||||
|
||||
confirm-required-jobs-passed:
|
||||
runs-on: ubuntu-latest
|
||||
name: All docs jobs passed
|
||||
# If any new job gets added, be sure to add it to this array
|
||||
needs: [test-doc, build-implementers-guide]
|
||||
if: always() && !cancelled()
|
||||
steps:
|
||||
- run: |
|
||||
tee resultfile <<< '${{ toJSON(needs) }}'
|
||||
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
|
||||
if [ $FAILURES -gt 0 ]; then
|
||||
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
publish-rustdoc:
|
||||
if: github.ref == 'refs/heads/master'
|
||||
runs-on: ubuntu-latest
|
||||
environment: subsystem-benchmarks
|
||||
needs: [build-rustdoc, build-implementers-guide]
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: gh-pages
|
||||
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ secrets.PEZKUWI_GHPAGES_APP_ID }}
|
||||
private-key: ${{ secrets.PEZKUWI_GHPAGES_APP_KEY }}
|
||||
- name: Ensure destination dir does not exist
|
||||
run: |
|
||||
rm -rf book/
|
||||
rm -rf ${REF_NAME}
|
||||
env:
|
||||
REF_NAME: ${{ github.head_ref || github.ref_name }}
|
||||
- name: Download rustdocs
|
||||
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: ${{ github.sha }}-doc
|
||||
path: /tmp/rustdocs
|
||||
- name: Extract rustdocs
|
||||
run: |
|
||||
tar xzf /tmp/rustdocs/crate-docs.tar.gz -C .
|
||||
mv crate-docs ${REF_NAME}
|
||||
env:
|
||||
REF_NAME: ${{ github.head_ref || github.ref_name }}
|
||||
- name: Download guide
|
||||
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: ${{ github.sha }}-guide
|
||||
path: /tmp
|
||||
- run: mkdir -p book
|
||||
- name: Move book files
|
||||
run: mv /tmp/book/html/* book/
|
||||
- name: Push changes to gh-pages
|
||||
env:
|
||||
TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
APP_NAME: "pezkuwichain-upd-ghpages"
|
||||
REF_NAME: ${{ github.head_ref || github.ref_name }}
|
||||
Green: "\e[32m"
|
||||
NC: "\e[0m"
|
||||
run: |
|
||||
echo "${Green}Git add${NC}"
|
||||
git add book/
|
||||
git add ${REF_NAME}/
|
||||
|
||||
echo "${Green}git status | wc -l${NC}"
|
||||
git status | wc -l
|
||||
|
||||
echo "${Green}Add new remote with gh app token${NC}"
|
||||
git remote set-url origin $(git config remote.origin.url | sed "s/github.com/${APP_NAME}:${TOKEN}@github.com/g")
|
||||
|
||||
echo "${Green}Remove http section that causes issues with gh app auth token${NC}"
|
||||
sed -i.bak '/\[http/d' ./.git/config
|
||||
sed -i.bak '/extraheader/d' ./.git/config
|
||||
|
||||
echo "${Green}Git push${NC}"
|
||||
git config user.email "ci@pezkuwichain.io"
|
||||
git config user.name "${APP_NAME}"
|
||||
git commit --amend -m "___Updated docs" || echo "___Nothing to commit___"
|
||||
git push origin gh-pages --force
|
||||
@@ -1,17 +0,0 @@
|
||||
# If the author of the issues is not a contributor to the project, label
|
||||
# the issue with 'Z0-unconfirmed'
|
||||
|
||||
name: Label New Issues
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
label-new-issues:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Label drafts
|
||||
uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90 # 1.0.4
|
||||
if: github.event.issue.author_association == 'NONE'
|
||||
with:
|
||||
add-labels: "I10-unconfirmed"
|
||||
@@ -1,41 +0,0 @@
|
||||
# Mirror upstream CI image to GHCR so we control our own build infrastructure.
|
||||
# Runs manually or when .github/env changes (new CI image version).
|
||||
name: Mirror CI Image
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: [".github/env"]
|
||||
|
||||
permissions:
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
mirror:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Read source image from env file
|
||||
id: source
|
||||
run: |
|
||||
SOURCE_IMAGE=$(grep '^IMAGE=' .github/env | cut -d'"' -f2)
|
||||
TAG=$(echo "$SOURCE_IMAGE" | cut -d: -f2)
|
||||
echo "source=$SOURCE_IMAGE" >> "$GITHUB_OUTPUT"
|
||||
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
|
||||
echo "Source: $SOURCE_IMAGE"
|
||||
|
||||
- name: Log in to GHCR
|
||||
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Pull, tag, and push to GHCR
|
||||
run: |
|
||||
docker pull "${{ steps.source.outputs.source }}"
|
||||
docker tag "${{ steps.source.outputs.source }}" "ghcr.io/pezkuwichain/ci-unified:${{ steps.source.outputs.tag }}"
|
||||
docker push "ghcr.io/pezkuwichain/ci-unified:${{ steps.source.outputs.tag }}"
|
||||
echo "Mirrored to ghcr.io/pezkuwichain/ci-unified:${{ steps.source.outputs.tag }}"
|
||||
@@ -1,25 +0,0 @@
|
||||
# Actions that makes review-bot green in the merge queue
|
||||
name: Merge-Queue
|
||||
|
||||
on:
|
||||
merge_group:
|
||||
|
||||
jobs:
|
||||
trigger-merge-queue-action:
|
||||
runs-on: ubuntu-latest
|
||||
environment: merge-queues
|
||||
steps:
|
||||
- name: Generate token
|
||||
id: app_token
|
||||
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
|
||||
with:
|
||||
app_id: ${{ secrets.REVIEW_APP_ID }}
|
||||
private_key: ${{ secrets.REVIEW_APP_KEY }}
|
||||
- name: Add Merge Queue status check
|
||||
uses: billyjbryant/create-status-check@3e6fa0ac599d10d9588cf9516ca4330ef669b858 # v2
|
||||
with:
|
||||
authToken: ${{ steps.app_token.outputs.token }}
|
||||
context: "review-bot"
|
||||
description: "PRs for merge queue gets approved"
|
||||
state: "success"
|
||||
sha: ${{ github.event.merge_group.head_commit.id }}
|
||||
@@ -1,84 +0,0 @@
|
||||
name: Check publish build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
check-publish-compile:
|
||||
timeout-minutes: 90
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
RUSTFLAGS: "-D warnings"
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
|
||||
with:
|
||||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||||
|
||||
- name: install pezkuwi-publish
|
||||
run: |
|
||||
cargo install pezkuwi-publish@0.10.6 --locked -q
|
||||
|
||||
- name: set current PR's prdoc name in a variable
|
||||
env:
|
||||
GITHUB_PR_NUM: ${{ github.event.pull_request.number }}
|
||||
run: |
|
||||
echo "CURRENT_PRDOC=pr_${GITHUB_PR_NUM}.prdoc" >> $GITHUB_ENV
|
||||
|
||||
- name: pezkuwi-publish update plan w/o current prdoc
|
||||
run: |
|
||||
if [ -f prdoc/$CURRENT_PRDOC ]; then
|
||||
mv prdoc/$CURRENT_PRDOC .
|
||||
fi
|
||||
pezkuwi-publish --color always plan --skip-check --prdoc prdoc/
|
||||
|
||||
# The code base is not in master's state (due to commits brought by the
|
||||
# current PR), but we're interested in all master's prdocs to be applied
|
||||
# as if master is a stable branch, and in next steps we're following up with
|
||||
# a patch release of all crates based on some newly added prdocs
|
||||
# (meaning only the current prdoc).
|
||||
- name: pezkuwi-publish apply plan on the code state prior to current prdoc
|
||||
run: pezkuwi-publish --color always apply --registry
|
||||
|
||||
- name: move all prdocs except current one to unstable dir
|
||||
run: |
|
||||
if [ -f $CURRENT_PRDOC ]; then
|
||||
mkdir prdoc/unstable
|
||||
mv prdoc/pr_*.prdoc prdoc/unstable
|
||||
mv $CURRENT_PRDOC prdoc
|
||||
fi
|
||||
|
||||
- name: pezkuwi-publish update plan just for PR's prdoc
|
||||
run: |
|
||||
if [ -f "prdoc/$CURRENT_PRDOC" ]; then
|
||||
pezkuwi-publish --color always plan --skip-check --prdoc prdoc/
|
||||
fi
|
||||
|
||||
- name: pezkuwi-publish apply plan
|
||||
run: |
|
||||
if [ -f "prdoc/$CURRENT_PRDOC" ]; then
|
||||
pezkuwi-publish --color always apply --registry
|
||||
fi
|
||||
|
||||
- name: pezkuwi-publish check compile
|
||||
run: |
|
||||
packages="$(pezkuwi-publish apply --print)"
|
||||
|
||||
if [ -n "$packages" ]; then
|
||||
cargo --color always check $(printf -- '-p %s ' $packages)
|
||||
fi
|
||||
@@ -1,48 +0,0 @@
|
||||
name: Check publish
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
check-publish:
|
||||
runs-on: ubuntu-latest
|
||||
needs: isdraft
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
|
||||
- name: Check for publishable crates
|
||||
id: check-publishable
|
||||
run: |
|
||||
# Find crates that are publishable (don't have publish = false)
|
||||
PUBLISHABLE=$(find . -name "Cargo.toml" -exec grep -L 'publish = false' {} \; | grep -v target | head -20)
|
||||
if [ -z "$PUBLISHABLE" ]; then
|
||||
echo "No publishable crates found (all have publish = false)"
|
||||
echo "has_publishable=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "Found publishable crates:"
|
||||
echo "$PUBLISHABLE"
|
||||
echo "has_publishable=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Rust Cache
|
||||
if: steps.check-publishable.outputs.has_publishable == 'true'
|
||||
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
|
||||
with:
|
||||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||||
|
||||
- name: Install pezkuwi-publish (when ready)
|
||||
if: steps.check-publishable.outputs.has_publishable == 'true'
|
||||
run: |
|
||||
echo "Publishable crates detected - publish checks will run when pezkuwi-publish tool is ready"
|
||||
# TODO: Replace with pezkuwi-publish when available
|
||||
# cargo install pezkuwi-publish --locked -q
|
||||
|
||||
- name: Skip - all crates have publish = false
|
||||
if: steps.check-publishable.outputs.has_publishable == 'false'
|
||||
run: echo "All crates have publish = false, skipping publish checks"
|
||||
@@ -0,0 +1,67 @@
|
||||
name: quick-checks
|
||||
|
||||
# Fast, lightweight correctness gates. These run on GitHub-hosted runners (free,
|
||||
# parallel) so they do not consume the self-hosted build runner. Ported and adapted
|
||||
# from the upstream Substrate quick-checks.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# Cargo.toml formatting is consistent (taplo).
|
||||
toml-format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Install taplo
|
||||
run: cargo install taplo-cli --locked -q || cargo install taplo-cli --locked
|
||||
- name: Check TOML formatting
|
||||
run: taplo format --check --config .config/taplo.toml
|
||||
|
||||
# Feature propagation is correct across the dependency tree (std / runtime-benchmarks
|
||||
# / try-runtime). Broken propagation can produce a runtime that does not build no_std
|
||||
# — a fund-critical correctness property.
|
||||
zepter:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Install zepter
|
||||
run: cargo install zepter@1.82.1 --locked -q || cargo install zepter@1.82.1 --locked
|
||||
- name: Run zepter
|
||||
run: zepter run check
|
||||
|
||||
# No leftover CI-blocking markers in the tree.
|
||||
fail-ci:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Check for FAIL-CI markers
|
||||
run: |
|
||||
set -e
|
||||
if grep -rI --include="*.rs" --exclude-dir=target "FAIL-CI" .; then
|
||||
echo "::error::Found FAIL-CI marker(s) — resolve before merging."
|
||||
exit 1
|
||||
fi
|
||||
echo "no FAIL-CI markers"
|
||||
|
||||
# No git dependencies sneak into the workspace (reproducibility). Vendored/patched
|
||||
# crates are allowed via [patch]; this guards [dependencies].
|
||||
no-git-deps:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Install checker deps
|
||||
run: python3 -m pip install --break-system-packages "cargo-workspace>=1.2.4" toml
|
||||
- name: Deny git dependencies in [workspace.dependencies]
|
||||
# [patch.crates-io] entries (vendored/wasm-fix forks) are allowed and not checked.
|
||||
run: python3 .github/scripts/deny-git-deps.py .
|
||||
@@ -1,300 +0,0 @@
|
||||
name: Release - Build node release candidate
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
binary:
|
||||
description: Binary to be build for the release
|
||||
default: all
|
||||
type: choice
|
||||
options:
|
||||
- pezkuwi
|
||||
- pezkuwi-teyrchain
|
||||
- pezkuwi-omni-node
|
||||
- pezframe-omni-bencher
|
||||
- chain-spec-builder
|
||||
- bizinikiwi-node
|
||||
- eth-rpc
|
||||
- pez-subkey
|
||||
- all
|
||||
|
||||
release_tag:
|
||||
description: Tag matching the actual release candidate with the format pezkuwi-stableYYMM(-X)-rcX or pezkuwi-stableYYMM(-X)
|
||||
type: string
|
||||
|
||||
workflow_call:
|
||||
inputs:
|
||||
binary:
|
||||
description: Binary to be built for the release
|
||||
default: all
|
||||
type: string
|
||||
release_tag:
|
||||
description: Tag matching the actual release candidate with the format pezkuwi-stableYYMM(-X)-rcY or pezkuwi-stableYYMM(-X)
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
# DISABLED: Workflow synchronization check
|
||||
# check-synchronization:
|
||||
# uses: pezkuwichain-release/sync-workflows/.github/workflows/check-synchronization.yml@main
|
||||
# secrets:
|
||||
# fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
|
||||
|
||||
validate-inputs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Validate inputs
|
||||
id: validate_inputs
|
||||
run: |
|
||||
. ./.github/scripts/common/lib.sh
|
||||
|
||||
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
|
||||
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
|
||||
|
||||
build-pezkuwi-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'pezkuwi' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["pezkuwi", "pezkuwi-prepare-worker", "pezkuwi-execute-worker"]'
|
||||
package: pezkuwi
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: x86_64-unknown-linux-gnu
|
||||
secrets: inherit
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-pezkuwi-teyrchain-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'pezkuwi-teyrchain' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["pezkuwi-teyrchain"]'
|
||||
package: "pezkuwi-teyrchain-bin"
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: x86_64-unknown-linux-gnu
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-pezkuwi-omni-node-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'pezkuwi-omni-node' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["pezkuwi-omni-node"]'
|
||||
package: "pezkuwi-omni-node"
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: x86_64-unknown-linux-gnu
|
||||
features: runtime-benchmarks
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-pezframe-omni-bencher-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'pezframe-omni-bencher' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["pezframe-omni-bencher"]'
|
||||
package: "pezframe-omni-bencher"
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: x86_64-unknown-linux-gnu
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-chain-spec-builder-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'chain-spec-builder' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["chain-spec-builder"]'
|
||||
package: pez-staging-chain-spec-builder
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: x86_64-unknown-linux-gnu
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-bizinikiwi-node-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'bizinikiwi-node' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["bizinikiwi-node"]'
|
||||
package: pezstaging-node-cli
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: x86_64-unknown-linux-gnu
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-eth-rpc-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'eth-rpc' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["eth-rpc"]'
|
||||
package: pezpallet-revive-eth-rpc
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: x86_64-unknown-linux-gnu
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-pez-subkey-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'pez-subkey' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["pez-subkey"]'
|
||||
package: pez-subkey
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: x86_64-unknown-linux-gnu
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-pezkuwi-macos-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'pezkuwi' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["pezkuwi", "pezkuwi-prepare-worker", "pezkuwi-execute-worker"]'
|
||||
package: pezkuwi
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: aarch64-apple-darwin
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-pezkuwi-teyrchain-macos-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'pezkuwi-teyrchain' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["pezkuwi-teyrchain"]'
|
||||
package: pezkuwi-teyrchain-bin
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: aarch64-apple-darwin
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-pezkuwi-omni-node-macos-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'pezkuwi-omni-node' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["pezkuwi-omni-node"]'
|
||||
package: pezkuwi-omni-node
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: aarch64-apple-darwin
|
||||
features: runtime-benchmarks
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-pezframe-omni-bencher-macos-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'pezframe-omni-bencher' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["pezframe-omni-bencher"]'
|
||||
package: pezframe-omni-bencher
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: aarch64-apple-darwin
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-chain-spec-builder-macos-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'chain-spec-builder' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["chain-spec-builder"]'
|
||||
package: pez-staging-chain-spec-builder
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: aarch64-apple-darwin
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-bizinikiwi-node-macos-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'bizinikiwi-node' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["bizinikiwi-node"]'
|
||||
package: pezstaging-node-cli
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: aarch64-apple-darwin
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-eth-rpc-macos-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'eth-rpc' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["eth-rpc"]'
|
||||
package: pezpallet-revive-eth-rpc
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: aarch64-apple-darwin
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-pez-subkey-macos-binary:
|
||||
needs: [validate-inputs]
|
||||
if: ${{ inputs.binary == 'pez-subkey' || inputs.binary == 'all' }}
|
||||
uses: "./.github/workflows/release-reusable-rc-build.yml"
|
||||
with:
|
||||
binary: '["pez-subkey"]'
|
||||
package: pez-subkey
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
target: aarch64-apple-darwin
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
@@ -1,90 +0,0 @@
|
||||
name: Release - Build runtimes
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
chain:
|
||||
description: The chain to use
|
||||
default: all
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- all
|
||||
- zagros
|
||||
- asset-hub-zagros
|
||||
- bridge-hub-zagros
|
||||
- collectives-zagros
|
||||
- coretime-zagros
|
||||
- glutton-zagros
|
||||
- people-zagros
|
||||
runtime_dir:
|
||||
description: The runtime dir to be used (⚠️ this parameter is optional and needed only in case of the single runtime build, set it accordingly to the runtime you want to build)
|
||||
default: pezkuwi/runtime/zagros
|
||||
type: choice
|
||||
options:
|
||||
- pezkuwi/runtime/zagros
|
||||
- pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros
|
||||
- pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros
|
||||
- pezcumulus/teyrchains/runtimes/collectives/collectives-zagros
|
||||
- pezcumulus/teyrchains/runtimes/coretime/coretime-zagros
|
||||
- pezcumulus/teyrchains/runtimes/people/people-zagros
|
||||
- pezcumulus/teyrchains/runtimes/glutton/glutton-zagros
|
||||
|
||||
release_tag:
|
||||
description: Tag matching the actual release candidate with the format pezkuwi-stableYYMM(-X)-rcY or pezkuwi-stableYYMM(-X)
|
||||
type: string
|
||||
|
||||
workflow_call:
|
||||
inputs:
|
||||
chain:
|
||||
description: The chain to use
|
||||
default: all
|
||||
required: true
|
||||
type: string
|
||||
runtime_dir:
|
||||
description: The runtime dir to be used (⚠️ this parameter is optional and needed only in case of the single runtime build, set it accordingly to the runtime you want to build)
|
||||
default: pezkuwi/runtime/zagros
|
||||
type: string
|
||||
release_tag:
|
||||
description: Tag matching the actual release candidate with the format pezkuwi-stableYYMM(-X)-rcY or pezkuwi-stableYYMM(-X)
|
||||
type: string
|
||||
outputs:
|
||||
published_runtimes:
|
||||
value: ${{ jobs.build-runtimes.outputs.published_runtimes }}
|
||||
|
||||
jobs:
|
||||
# DISABLED: Workflow synchronization check
|
||||
# check-synchronization:
|
||||
# uses: pezkuwichain-release/sync-workflows/.github/workflows/check-synchronization.yml@main
|
||||
# secrets:
|
||||
# fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
|
||||
|
||||
validate-inputs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Validate inputs
|
||||
id: validate_inputs
|
||||
run: |
|
||||
. ./.github/scripts/common/lib.sh
|
||||
|
||||
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
|
||||
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
|
||||
|
||||
build-runtimes:
|
||||
needs: [validate-inputs]
|
||||
uses: "./.github/workflows/release-srtool.yml"
|
||||
with:
|
||||
excluded_runtimes: "asset-hub-pezkuwichain bridge-hub-pezkuwichain coretime-pezkuwichain people-pezkuwichain pezkuwichain pezkuwichain-teyrchain bizinikiwi-test bp pezcumulus-test kitchensink minimal-template teyrchain-template penpal pezkuwi-test seedling shell pezframe-try sp solochain-template pezkuwi-sdk-docs-first pezpallet-staking-async-teyrchain pezpallet-staking-async-rc pezframe-storage-access-test yet-another-teyrchain revive-dev"
|
||||
build_opts: "--features on-chain-release-build"
|
||||
profile: production
|
||||
chain: ${{ inputs.chain }}
|
||||
runtime_dir: ${{ inputs.runtime_dir }}
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
@@ -1,126 +0,0 @@
|
||||
name: Release - Combined Builds Flow
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
chain:
|
||||
description: The chain to use for runtime builds
|
||||
default: all
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- all
|
||||
- zagros
|
||||
- asset-hub-zagros
|
||||
- bridge-hub-zagros
|
||||
- collectives-zagros
|
||||
- coretime-zagros
|
||||
- glutton-zagros
|
||||
- people-zagros
|
||||
runtime_dir:
|
||||
description: The runtime dir to be used (⚠️ this parameter is optional and needed only in case of the single runtime build, set it accordingly to the runtime you want to build)
|
||||
default: pezkuwi/runtime/zagros
|
||||
type: choice
|
||||
options:
|
||||
- pezkuwi/runtime/zagros
|
||||
- pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros
|
||||
- pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros
|
||||
- pezcumulus/teyrchains/runtimes/collectives/collectives-zagros
|
||||
- pezcumulus/teyrchains/runtimes/coretime/coretime-zagros
|
||||
- pezcumulus/teyrchains/runtimes/people/people-zagros
|
||||
- pezcumulus/teyrchains/runtimes/glutton/glutton-zagros
|
||||
binary:
|
||||
description: Binary to be built for the release candidate
|
||||
default: all
|
||||
type: choice
|
||||
options:
|
||||
- pezkuwi
|
||||
- pezkuwi-teyrchain
|
||||
- pezkuwi-omni-node
|
||||
- pezframe-omni-bencher
|
||||
- chain-spec-builder
|
||||
- bizinikiwi-node
|
||||
- eth-rpc
|
||||
- pez-subkey
|
||||
- all
|
||||
release_tag:
|
||||
description: Tag matching the actual release candidate with the format pezkuwi-stableYYMM(-X)-rcY or pezkuwi-stableYYMM(-X)
|
||||
type: string
|
||||
required: true
|
||||
no_runtimes:
|
||||
description: If true, no runtime build will be triggered and release draft will be published without runtimes (⚠️ use it for the patch releases of the latest stable)
|
||||
required: true
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
# DISABLED: Workflow synchronization check
|
||||
# check-synchronization:
|
||||
# uses: pezkuwichain-release/sync-workflows/.github/workflows/check-synchronization.yml@main
|
||||
# secrets:
|
||||
# fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
|
||||
|
||||
validate-inputs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
release_tag: ${{ steps.validate_inputs.outputs.release_tag }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Validate inputs
|
||||
id: validate_inputs
|
||||
run: |
|
||||
. ./.github/scripts/common/lib.sh
|
||||
|
||||
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
|
||||
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
|
||||
|
||||
build-runtimes-flow:
|
||||
if: ${{ inputs.no_runtimes == false }}
|
||||
needs: [validate-inputs]
|
||||
uses: "./.github/workflows/release-21_build-runtimes.yml"
|
||||
with:
|
||||
chain: ${{ inputs.chain }}
|
||||
runtime_dir: ${{ inputs.runtime_dir }}
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
build-rc-flow:
|
||||
needs: [validate-inputs]
|
||||
uses: "./.github/workflows/release-20_build-rc.yml"
|
||||
with:
|
||||
binary: ${{ inputs.binary }}
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
secrets: inherit
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
trigger-release-draft-with-runtimes:
|
||||
if: ${{ inputs.no_runtimes == false }}
|
||||
needs: [build-runtimes-flow, build-rc-flow, validate-inputs]
|
||||
uses: "./.github/workflows/release-30_publish_release_draft.yml"
|
||||
with:
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
build_run_id: ${{ github.run_id }}
|
||||
runtimes: '${{ needs.build-runtimes-flow.outputs.published_runtimes }}'
|
||||
no_runtimes: ${{ inputs.no_runtimes }}
|
||||
crates_only: false
|
||||
secrets: inherit
|
||||
|
||||
trigger-release-draft-without-runtimes:
|
||||
if: ${{ inputs.no_runtimes == true }}
|
||||
needs: [build-rc-flow, validate-inputs]
|
||||
uses: "./.github/workflows/release-30_publish_release_draft.yml"
|
||||
with:
|
||||
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
|
||||
build_run_id: ${{ github.run_id }}
|
||||
no_runtimes: ${{ inputs.no_runtimes }}
|
||||
crates_only: false
|
||||
secrets: inherit
|
||||
@@ -1,99 +0,0 @@
|
||||
name: Release - Announce release to Discord
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
- prereleased
|
||||
|
||||
jobs:
|
||||
ping_discord:
|
||||
runs-on: ubuntu-latest
|
||||
environment: release
|
||||
# Discord notification - Pezkuwi uses Discord instead of Matrix
|
||||
# Server ID: 1444335345935057049
|
||||
# Discord webhook should be configured in repository secrets as PEZKUWI_DISCORD_WEBHOOK
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: ${{ github.event.release.tag_name }}
|
||||
|
||||
- name: Extract node version
|
||||
id: extract_version
|
||||
run: |
|
||||
. ./.github/scripts/common/lib.sh
|
||||
|
||||
version=v$(get_pezkuwi_node_version_from_code)
|
||||
echo "Extracted node version: $version"
|
||||
echo "node_version=$version" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Send Discord notification
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.PEZKUWI_DISCORD_WEBHOOK }}
|
||||
run: |
|
||||
if [ -z "$DISCORD_WEBHOOK" ]; then
|
||||
echo "::notice::Discord webhook not configured. Release notification skipped."
|
||||
echo "Release: ${{ github.event.release.tag_name }}"
|
||||
echo "URL: ${{ github.event.release.html_url }}"
|
||||
echo "Node Version: ${{ steps.extract_version.outputs.node_version }}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
RELEASE_TYPE="${{ github.event.action }}"
|
||||
TAG_NAME="${{ github.event.release.tag_name }}"
|
||||
RELEASE_URL="${{ github.event.release.html_url }}"
|
||||
NODE_VERSION="${{ steps.extract_version.outputs.node_version }}"
|
||||
REPO_NAME="${{ github.event.repository.full_name }}"
|
||||
|
||||
# Set emoji based on release type
|
||||
if [ "${{ github.event.release.prerelease }}" == "true" ]; then
|
||||
EMOJI="🧪"
|
||||
TITLE="Pre-release Published"
|
||||
else
|
||||
EMOJI="🚀"
|
||||
TITLE="New Release Published"
|
||||
fi
|
||||
|
||||
# Create Discord embed payload
|
||||
PAYLOAD=$(cat <<'PAYLOAD_EOF'
|
||||
{
|
||||
"embeds": [{
|
||||
"title": "EMOJI_PLACEHOLDER TITLE_PLACEHOLDER",
|
||||
"description": "A new node release has been RELEASE_TYPE_PLACEHOLDER in **REPO_NAME_PLACEHOLDER**",
|
||||
"color": 5814783,
|
||||
"fields": [
|
||||
{
|
||||
"name": "Release Version",
|
||||
"value": "[TAG_NAME_PLACEHOLDER](RELEASE_URL_PLACEHOLDER)",
|
||||
"inline": true
|
||||
},
|
||||
{
|
||||
"name": "Node Version",
|
||||
"value": "NODE_VERSION_PLACEHOLDER",
|
||||
"inline": true
|
||||
}
|
||||
],
|
||||
"footer": {
|
||||
"text": "Pezkuwi SDK Release"
|
||||
},
|
||||
"timestamp": "TIMESTAMP_PLACEHOLDER"
|
||||
}]
|
||||
}
|
||||
PAYLOAD_EOF
|
||||
)
|
||||
|
||||
# Replace placeholders with actual values
|
||||
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||
PAYLOAD="${PAYLOAD//EMOJI_PLACEHOLDER/$EMOJI}"
|
||||
PAYLOAD="${PAYLOAD//TITLE_PLACEHOLDER/$TITLE}"
|
||||
PAYLOAD="${PAYLOAD//RELEASE_TYPE_PLACEHOLDER/$RELEASE_TYPE}"
|
||||
PAYLOAD="${PAYLOAD//REPO_NAME_PLACEHOLDER/$REPO_NAME}"
|
||||
PAYLOAD="${PAYLOAD//TAG_NAME_PLACEHOLDER/$TAG_NAME}"
|
||||
PAYLOAD="${PAYLOAD//RELEASE_URL_PLACEHOLDER/$RELEASE_URL}"
|
||||
PAYLOAD="${PAYLOAD//NODE_VERSION_PLACEHOLDER/$NODE_VERSION}"
|
||||
PAYLOAD="${PAYLOAD//TIMESTAMP_PLACEHOLDER/$TIMESTAMP}"
|
||||
|
||||
curl -H "Content-Type: application/json" \
|
||||
-d "$PAYLOAD" \
|
||||
"$DISCORD_WEBHOOK"
|
||||
@@ -1,81 +0,0 @@
|
||||
name: Binary Build
|
||||
# This workflow can be used to build a binary like pezkuwi + workers, omninode or pezkuwi-teyrchain
|
||||
# from any branch with release or profuction profile to be later used for testing.
|
||||
# ⚠️ IT should not be used for release purposes!
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
binary:
|
||||
required: true
|
||||
default: "pezkuwi"
|
||||
description: "The binary to build"
|
||||
package:
|
||||
description: Package to be built, can be pezkuwi, pezkuwi-teyrchain-bin, pezkuwi-omni-node etc.
|
||||
required: true
|
||||
type: string
|
||||
profile:
|
||||
required: true
|
||||
default: "release"
|
||||
description: "The profile to use for the binary build"
|
||||
features:
|
||||
required: false
|
||||
type: string
|
||||
description: "Features to enable when building the binary (must be a list of comma-separated features)"
|
||||
|
||||
jobs:
|
||||
|
||||
setup:
|
||||
# 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
|
||||
outputs:
|
||||
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
|
||||
RUNNER: ${{ steps.set_runner.outputs.RUNNER }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Set image
|
||||
id: set_image
|
||||
run: cat .github/env >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set runner
|
||||
id: set_runner
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "${{ inputs.binary }}" == "pezkuwi-teyrchain" ]]; then
|
||||
echo "RUNNER=pezkuwichain-large" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "RUNNER=ubuntu-latest" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
build:
|
||||
needs: [setup]
|
||||
runs-on: ${{ needs.setup.outputs.RUNNER }}
|
||||
container:
|
||||
image: ${{ needs.setup.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Build binary
|
||||
run: |
|
||||
git config --global --add safe.directory "${GITHUB_WORKSPACE}" #avoid "detected dubious ownership" error
|
||||
PROFILE=${{ inputs.profile }}
|
||||
if [ "${{ inputs.binary }}" = "pezkuwi" ]; then
|
||||
for binary in pezkuwi pezkuwi-prepare-worker pezkuwi-execute-worker; do
|
||||
echo "Building $binary with profile $PROFILE and features ${{ inputs.features }}"
|
||||
./.github/scripts/release/build-linux-release.sh $binary ${{ inputs.package }} ${{ inputs.features }}
|
||||
done
|
||||
else
|
||||
echo "Building ${{ inputs.binary }} with profile $PROFILE and features ${{ inputs.features }}"
|
||||
./.github/scripts/release/build-linux-release.sh ${{ inputs.binary }} ${{ inputs.package }} ${{ inputs.features }}
|
||||
fi
|
||||
|
||||
- name: Upload ${{ inputs.binary }} artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ inputs.binary }}
|
||||
path: /artifacts/**
|
||||
@@ -1,94 +0,0 @@
|
||||
name: Check Runtimes Specs
|
||||
# This GH Workflow fetches the runtimes available in a release.
|
||||
# It then compares their metadata with reference specs located under
|
||||
# .github/runtime_specs.
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release_id:
|
||||
description: |
|
||||
Release ID.
|
||||
You can find it using the command:
|
||||
curl -s \
|
||||
-H "Authorization: Bearer ${GITHUB_TOKEN}" https://api.github.com/repos/pezkuwichain/pezkuwi-sdk/releases | \
|
||||
jq '.[] | { name: .name, id: .id }'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
# This trigger unfortunately does not work as expected.
|
||||
# https://github.com/orgs/community/discussions/47794
|
||||
# release:
|
||||
# types: [edited]
|
||||
|
||||
env:
|
||||
RUNTIME_SPECS_DIR: .github/runtime_specs
|
||||
DATA_DIR: runtimes
|
||||
RELEASE_ID: ${{ inputs.release_id }}
|
||||
REPO: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
find-specs:
|
||||
name: Fetch runtime specs
|
||||
outputs:
|
||||
specs: ${{ steps.get-list.outputs.specs }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the repo
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
|
||||
- name: Get list
|
||||
id: get-list
|
||||
run: |
|
||||
lst=$(ls $RUNTIME_SPECS_DIR/*.json | xargs -I{} basename "{}" .json | jq -R .| jq -sc .)
|
||||
echo "Found: $lst"
|
||||
echo "specs=$lst" >> $GITHUB_OUTPUT
|
||||
|
||||
check-runtimes:
|
||||
name: Check runtime specs
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- find-specs
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
specs: ${{ fromJSON(needs.find-specs.outputs.specs) }}
|
||||
|
||||
steps:
|
||||
- name: Checkout the repo
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
|
||||
|
||||
- name: Fetch release artifacts based on release id
|
||||
env:
|
||||
OUTPUT_DIR: ${{ env.DATA_DIR }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
. ./.github/scripts/common/lib.sh
|
||||
fetch_release_artifacts
|
||||
|
||||
- name: Install tooling
|
||||
env:
|
||||
SUBWASM_VERSION: v0.20.0
|
||||
DL_BASE_URL: https://github.com/chevdor/subwasm/releases/download
|
||||
run: |
|
||||
wget $DL_BASE_URL/$SUBWASM_VERSION/subwasm_linux_amd64_$SUBWASM_VERSION.deb \
|
||||
-O subwasm.deb
|
||||
sudo dpkg -i subwasm.deb
|
||||
subwasm --version
|
||||
|
||||
- name: Extract metadata JSON for ${{ matrix.specs }}
|
||||
env:
|
||||
RUNTIME: ${{ matrix.specs }}
|
||||
run: |
|
||||
WASM=$(ls ${DATA_DIR}/${RUNTIME}*.wasm)
|
||||
echo "WASM=$WASM"
|
||||
subwasm show --json "$WASM" > "${DATA_DIR}/${RUNTIME}.json"
|
||||
|
||||
- name: Check specs for ${{ matrix.specs }}
|
||||
id: build
|
||||
env:
|
||||
RUNTIME: ${{ matrix.specs }}
|
||||
LOGLEVEL: info
|
||||
run: |
|
||||
python --version
|
||||
.github/scripts/check-runtime.py "${DATA_DIR}/${RUNTIME}.json" "${RUNTIME_SPECS_DIR}/${RUNTIME}.json"
|
||||
@@ -1,536 +0,0 @@
|
||||
name: RC Build
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
binary:
|
||||
description: Binary to be build for the release
|
||||
required: true
|
||||
default: pezkuwi
|
||||
type: string
|
||||
|
||||
package:
|
||||
description: Package to be built, for now can be pezkuwi, pezkuwi-teyrchain-bin, or pezkuwi-omni-node
|
||||
required: true
|
||||
type: string
|
||||
|
||||
release_tag:
|
||||
description: Tag matching the actual release candidate with the format pezkuwi-stableYYMM(-rcX) or pezkuwi-stableYYMM-X(-rcX)
|
||||
required: true
|
||||
type: string
|
||||
|
||||
target:
|
||||
description: Target triple for which the artifacts are being built (e.g. x86_64-unknown-linux-gnu)
|
||||
required: true
|
||||
type: string
|
||||
|
||||
features:
|
||||
description: Features to be enabled when building the binary (must be a list of comma-separated features)
|
||||
required: false
|
||||
type: string
|
||||
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
attestations: write
|
||||
|
||||
jobs:
|
||||
|
||||
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
|
||||
env:
|
||||
BINARY: ${{ inputs.binary }}
|
||||
outputs:
|
||||
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
|
||||
RUNNER: ${{ steps.set_image.outputs.RUNNER }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- id: set_image
|
||||
run: |
|
||||
cat .github/env >> $GITHUB_OUTPUT
|
||||
RUNNER=""
|
||||
if [[ "${BINARY}" =~ "pezkuwi-teyrchain" || "${BINARY}" =~ "pezkuwi-omni-node" ]]; then
|
||||
RUNNER="ubuntu-latest-m"
|
||||
echo "Using ubuntu-latest-m runner"
|
||||
else
|
||||
RUNNER="ubuntu-latest"
|
||||
echo "Using ubuntu-latest runner"
|
||||
fi
|
||||
echo "RUNNER=${RUNNER}" >> $GITHUB_OUTPUT
|
||||
|
||||
build-rc:
|
||||
if: ${{ inputs.target == 'x86_64-unknown-linux-gnu' }}
|
||||
needs: [set-image]
|
||||
runs-on: ${{ needs.set-image.outputs.RUNNER }}
|
||||
environment: release
|
||||
container:
|
||||
image: ${{ needs.set-image.outputs.IMAGE }}
|
||||
strategy:
|
||||
matrix:
|
||||
binaries: ${{ fromJSON(inputs.binary) }}
|
||||
env:
|
||||
PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
|
||||
PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
|
||||
|
||||
steps:
|
||||
- name: Install pgpkkms
|
||||
run: |
|
||||
# Install pgpkms that is used to sign built artifacts
|
||||
python3 -m pip install "pgpkms @ git+https://github.com/pezkuwichain-release/pgpkms.git@6cb1cecce1268412189b77e4b130f4fa248c4151"
|
||||
which pgpkms
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: ${{ inputs.release_tag }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Import gpg keys
|
||||
shell: bash
|
||||
run: |
|
||||
. ./.github/scripts/common/lib.sh
|
||||
|
||||
import_gpg_keys
|
||||
|
||||
- name: Build binary
|
||||
run: |
|
||||
git config --global --add safe.directory "${GITHUB_WORKSPACE}" #avoid "detected dubious ownership" error
|
||||
./.github/scripts/release/build-linux-release.sh ${{ matrix.binaries }} ${{ inputs.package }} ${{ inputs.features }}
|
||||
|
||||
- name: Generate artifact attestation
|
||||
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
|
||||
with:
|
||||
subject-path: /artifacts/${{ matrix.binaries }}/${{ matrix.binaries }}
|
||||
|
||||
- name: Sign artifacts
|
||||
working-directory: /artifacts/${{ matrix.binaries }}
|
||||
run: |
|
||||
python3 -m pgpkms sign --input ${{matrix.binaries }} -o ${{ matrix.binaries }}.asc
|
||||
|
||||
- name: Check sha256 ${{ matrix.binaries }}
|
||||
working-directory: /artifacts/${{ matrix.binaries }}
|
||||
shell: bash
|
||||
run: |
|
||||
. "${GITHUB_WORKSPACE}"/.github/scripts/common/lib.sh
|
||||
|
||||
echo "Checking binary ${{ matrix.binaries }}"
|
||||
check_sha256 ${{ matrix.binaries }}
|
||||
|
||||
- name: Check GPG ${{ matrix.binaries }}
|
||||
working-directory: /artifacts/${{ matrix.binaries }}
|
||||
shell: bash
|
||||
run: |
|
||||
. "${GITHUB_WORKSPACE}"/.github/scripts/common/lib.sh
|
||||
|
||||
check_gpg ${{ matrix.binaries }}
|
||||
|
||||
- name: Upload ${{ matrix.binaries }} artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ matrix.binaries }}_${{ inputs.target }}
|
||||
path: /artifacts/${{ matrix.binaries }}
|
||||
|
||||
build-macos-rc:
|
||||
if: ${{ inputs.target == 'aarch64-apple-darwin' }}
|
||||
runs-on: macos-latest
|
||||
environment: release
|
||||
strategy:
|
||||
matrix:
|
||||
binaries: ${{ fromJSON(inputs.binary) }}
|
||||
env:
|
||||
PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
|
||||
PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: ${{ inputs.release_tag }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set rust version from env file
|
||||
run: |
|
||||
RUST_VERSION=$(cat .github/env | sed -E 's/.*ci-unified:([^-]+)-([^-]+).*/\2/')
|
||||
echo $RUST_VERSION
|
||||
echo "RUST_VERSION=${RUST_VERSION}" >> $GITHUB_ENV
|
||||
- name: Set workspace environment variable
|
||||
# relevant for artifacts upload, which can not interpolate Github Action variable syntax when
|
||||
# used within valid paths. We can not use root-based paths either, since it is set as read-only
|
||||
# on the `pezkuwichain-macos` runner.
|
||||
run: echo "ARTIFACTS_PATH=${GITHUB_WORKSPACE}/artifacts/${{ matrix.binaries }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Set up Homebrew
|
||||
uses: Homebrew/actions/setup-homebrew@1ccc07ccd54b6048295516a3eb89b192c35057dc # master from 12.09.2024
|
||||
- name: Set homebrew binaries location on path
|
||||
run: echo "/opt/homebrew/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Install rust ${{ env.RUST_VERSION }}
|
||||
uses: actions-rust-lang/setup-rust-toolchain@a0b538fa0b742a6aa35d6e2c169b4bd06d225a98 # v1.15.3
|
||||
with:
|
||||
cache: false
|
||||
toolchain: ${{ env.RUST_VERSION }}
|
||||
target: wasm32v1-none
|
||||
components: cargo, clippy, rust-docs, rust-src, rustfmt, rustc, rust-std
|
||||
|
||||
- name: cargo info
|
||||
run: |
|
||||
echo "######## rustup show ########"
|
||||
rustup show
|
||||
echo "######## cargo --version ########"
|
||||
cargo --version
|
||||
|
||||
- name: Install protobuf
|
||||
run: brew install protobuf
|
||||
- name: Install gpg
|
||||
run: |
|
||||
brew install gnupg
|
||||
# Setup for being able to resolve: keyserver.ubuntu.com.
|
||||
# See: https://github.com/actions/runner-images/issues/9777
|
||||
mkdir -p ~/.gnupg/
|
||||
touch ~/.gnupg/dirmngr.conf
|
||||
echo "standard-resolver" > ~/.gnupg/dirmngr.conf
|
||||
|
||||
- name: Install solc
|
||||
run: brew install solidity
|
||||
|
||||
- name: Install resolc
|
||||
# NOTE: resolc is an upstream shared tool from paritytech/revive (EVM compiler)
|
||||
run: |
|
||||
VERSION="0.3.0"
|
||||
ASSET_URL="https://github.com/paritytech/revive/releases/download/v$VERSION/resolc-universal-apple-darwin"
|
||||
echo "Downloading resolc v$VERSION from $ASSET_URL"
|
||||
curl -Lsf --show-error -o $HOME/.cargo/bin/resolc "$ASSET_URL"
|
||||
chmod +x $HOME/.cargo/bin/resolc
|
||||
xattr -c $HOME/.cargo/bin/resolc
|
||||
resolc --version
|
||||
|
||||
- name: Install llvm
|
||||
run: |
|
||||
brew install llvm@21
|
||||
|
||||
- name: Set dynamic library path
|
||||
run: |
|
||||
LLVM_PATH=$(brew --prefix llvm)
|
||||
export LIBCLANG_PATH="$LLVM_PATH/lib"
|
||||
export LDFLAGS="-L$LLVM_PATH/lib"
|
||||
export CPPFLAGS="-I$LLVM_PATH/include"
|
||||
echo "DYLD_LIBRARY_PATH=$LLVM_PATH/lib" >> $GITHUB_ENV
|
||||
|
||||
- name: Install sha256sum
|
||||
run: |
|
||||
brew install coreutils
|
||||
|
||||
- name: Install pgpkkms
|
||||
run: |
|
||||
# Install pgpkms that is used to sign built artifacts
|
||||
python3 -m pip install "pgpkms @ git+https://github.com/pezkuwichain-release/pgpkms.git@6cb1cecce1268412189b77e4b130f4fa248c4151" --break-system-packages
|
||||
|
||||
- name: Import gpg keys
|
||||
shell: bash
|
||||
run: |
|
||||
. ./.github/scripts/common/lib.sh
|
||||
|
||||
import_gpg_keys
|
||||
|
||||
- name: Build binary
|
||||
run: |
|
||||
git config --global --add safe.directory "${GITHUB_WORKSPACE}" #avoid "detected dubious ownership" error
|
||||
./.github/scripts/release/build-macos-release.sh ${{ matrix.binaries }} ${{ inputs.package }} ${{ inputs.features }}
|
||||
|
||||
- name: Generate artifact attestation
|
||||
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
|
||||
with:
|
||||
subject-path: ${{ env.ARTIFACTS_PATH }}/${{ matrix.binaries }}
|
||||
|
||||
- name: Sign artifacts
|
||||
working-directory: ${{ env.ARTIFACTS_PATH }}
|
||||
run: |
|
||||
python3 -m pgpkms sign --input ${{matrix.binaries }} -o ${{ matrix.binaries }}.asc
|
||||
|
||||
- name: Check sha256 ${{ matrix.binaries }}
|
||||
working-directory: ${{ env.ARTIFACTS_PATH }}
|
||||
shell: bash
|
||||
run: |
|
||||
. "${GITHUB_WORKSPACE}"/.github/scripts/common/lib.sh
|
||||
|
||||
echo "Checking binary ${{ matrix.binaries }}"
|
||||
check_sha256 ${{ matrix.binaries }}
|
||||
|
||||
- name: Check GPG ${{ matrix.binaries }}
|
||||
working-directory: ${{ env.ARTIFACTS_PATH }}
|
||||
shell: bash
|
||||
run: |
|
||||
. "${GITHUB_WORKSPACE}"/.github/scripts/common/lib.sh
|
||||
|
||||
check_gpg ${{ matrix.binaries }}
|
||||
|
||||
- name: Upload ${{ matrix.binaries }} artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ matrix.binaries }}_${{ inputs.target }}
|
||||
path: ${{ env.ARTIFACTS_PATH }}
|
||||
|
||||
build-pezkuwi-deb-and-rpm-package:
|
||||
if: ${{ inputs.package == 'pezkuwi' && inputs.target == 'x86_64-unknown-linux-gnu' }}
|
||||
needs: [build-rc]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: ${{ inputs.release_tag }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Download pezkuwi_x86_64-unknown-linux-gnu artifacts
|
||||
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: pezkuwi_x86_64-unknown-linux-gnu
|
||||
path: target/production
|
||||
merge-multiple: true
|
||||
|
||||
- name: Download pezkuwi-execute-worker_x86_64-unknown-linux-gnu artifacts
|
||||
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: pezkuwi-execute-worker_x86_64-unknown-linux-gnu
|
||||
path: target/production
|
||||
merge-multiple: true
|
||||
|
||||
- name: Download pezkuwi-prepare-worker_x86_64-unknown-linux-gnu artifacts
|
||||
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
name: pezkuwi-prepare-worker_x86_64-unknown-linux-gnu
|
||||
path: target/production
|
||||
merge-multiple: true
|
||||
|
||||
- name: Install rpmbuild
|
||||
run: sudo apt-get update && sudo apt-get install -y rpm
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '3.2'
|
||||
|
||||
- name: Install fpm
|
||||
run: gem install fpm
|
||||
|
||||
- name: Build pezkuwi deb package
|
||||
shell: bash
|
||||
run: |
|
||||
. "${GITHUB_WORKSPACE}"/.github/scripts/common/lib.sh
|
||||
VERSION=$(get_pezkuwi_node_version_from_code)
|
||||
. "${GITHUB_WORKSPACE}"/.github/scripts/release/build-deb.sh ${{ inputs.package }} ${VERSION}
|
||||
|
||||
- name: Build pezkuwi rpm package
|
||||
shell: bash
|
||||
run: |
|
||||
. "${GITHUB_WORKSPACE}"/.github/scripts/common/lib.sh
|
||||
VERSION=$(get_pezkuwi_node_version_from_code)
|
||||
. "${GITHUB_WORKSPACE}"/.github/scripts/release/build-rpm.sh ${{ inputs.package }} ${VERSION}
|
||||
|
||||
- name: Generate artifact attestation
|
||||
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
|
||||
with:
|
||||
subject-path: |
|
||||
target/production/*.deb
|
||||
target/production/*.rpm
|
||||
|
||||
- name: Upload ${{inputs.package }} artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ inputs.package }}_${{ inputs.target }}
|
||||
path: target/production
|
||||
overwrite: true
|
||||
|
||||
upload-pezkuwi-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezkuwi' && inputs.target == 'x86_64-unknown-linux-gnu' }}
|
||||
needs: [build-pezkuwi-deb-and-rpm-package]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: ${{ inputs.package }}
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-pezkuwi-teyrchain-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezkuwi-teyrchain-bin' && inputs.target == 'x86_64-unknown-linux-gnu' }}
|
||||
needs: [build-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: pezkuwi-teyrchain
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-pezkuwi-omni-node-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezkuwi-omni-node' && inputs.target == 'x86_64-unknown-linux-gnu' }}
|
||||
needs: [build-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: ${{ inputs.package }}
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-pezframe-omni-bencher-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezframe-omni-bencher' && inputs.target == 'x86_64-unknown-linux-gnu' }}
|
||||
needs: [build-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: ${{ inputs.package }}
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-chain-spec-builder-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pez-staging-chain-spec-builder' && inputs.target == 'x86_64-unknown-linux-gnu' }}
|
||||
needs: [build-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: chain-spec-builder
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-bizinikiwi-node-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezstaging-node-cli' && inputs.target == 'x86_64-unknown-linux-gnu' }}
|
||||
needs: [build-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: bizinikiwi-node
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-eth-rpc-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezpallet-revive-eth-rpc' && inputs.target == 'x86_64-unknown-linux-gnu' }}
|
||||
needs: [build-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: eth-rpc
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-pez-subkey-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pez-subkey' && inputs.target == 'x86_64-unknown-linux-gnu' }}
|
||||
needs: [build-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: pez-subkey
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-pezkuwi-macos-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezkuwi' && inputs.target == 'aarch64-apple-darwin' }}
|
||||
# TODO: add and use a `build-pezkuwi-homebrew-package` which packs all `pezkuwi` binaries:
|
||||
# `pezkuwi`, `pezkuwi-prepare-worker` and `pezkuwi-execute-worker`.
|
||||
needs: [build-macos-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: ${{ inputs.package }}
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-pezkuwi-prepare-worker-macos-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezkuwi' && inputs.target == 'aarch64-apple-darwin' }}
|
||||
needs: [build-macos-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: pezkuwi-prepare-worker
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-pezkuwi-execute-worker-macos-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezkuwi' && inputs.target == 'aarch64-apple-darwin' }}
|
||||
needs: [build-macos-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: pezkuwi-execute-worker
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-pezkuwi-omni-node-macos-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezkuwi-omni-node' && inputs.target == 'aarch64-apple-darwin' }}
|
||||
needs: [build-macos-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: ${{ inputs.package }}
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-pezkuwi-teyrchain-macos-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezkuwi-teyrchain-bin' && inputs.target == 'aarch64-apple-darwin' }}
|
||||
needs: [build-macos-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: pezkuwi-teyrchain
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-pezframe-omni-bencher-macos-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezframe-omni-bencher' && inputs.target == 'aarch64-apple-darwin' }}
|
||||
needs: [build-macos-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: ${{ inputs.package }}
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-chain-spec-builder-macos-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pez-staging-chain-spec-builder' && inputs.target == 'aarch64-apple-darwin' }}
|
||||
needs: [build-macos-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: chain-spec-builder
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-bizinikiwi-node-macos-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezstaging-node-cli' && inputs.target == 'aarch64-apple-darwin' }}
|
||||
needs: [build-macos-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: bizinikiwi-node
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-eth-rpc-macos-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pezpallet-revive-eth-rpc' && inputs.target == 'aarch64-apple-darwin' }}
|
||||
needs: [build-macos-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: eth-rpc
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
|
||||
upload-pez-subkey-macos-artifacts-to-s3:
|
||||
if: ${{ inputs.package == 'pez-subkey' && inputs.target == 'aarch64-apple-darwin' }}
|
||||
needs: [build-macos-rc]
|
||||
uses: ./.github/workflows/release-reusable-s3-upload.yml
|
||||
with:
|
||||
package: pez-subkey
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
target: ${{ inputs.target }}
|
||||
secrets: inherit
|
||||
@@ -1,152 +0,0 @@
|
||||
name: Srtool build
|
||||
|
||||
env:
|
||||
SUBWASM_VERSION: 0.21.0
|
||||
TOML_CLI_VERSION: 0.2.4
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
excluded_runtimes:
|
||||
type: string
|
||||
build_opts:
|
||||
type: string
|
||||
profile:
|
||||
type: string
|
||||
chain:
|
||||
type: string
|
||||
runtime_dir:
|
||||
type: string
|
||||
outputs:
|
||||
published_runtimes:
|
||||
value: ${{ jobs.find-runtimes.outputs.runtime }}
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
find-runtimes:
|
||||
name: Scan repo pezkuwichain/pezkuwi-sdk
|
||||
outputs:
|
||||
runtime: ${{ steps.get_runtimes_list.outputs.runtime }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.0.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install tooling
|
||||
run: |
|
||||
URL=https://github.com/chevdor/toml-cli/releases/download/v${{ env.TOML_CLI_VERSION }}/toml_linux_amd64_v${{ env.TOML_CLI_VERSION }}.deb
|
||||
curl -L $URL --output toml.deb
|
||||
sudo dpkg -i toml.deb
|
||||
toml --version; jq --version
|
||||
|
||||
- name: Scan and get runtimes list
|
||||
id: get_runtimes_list
|
||||
env:
|
||||
EXCLUDED_RUNTIMES: ${{ inputs.excluded_runtimes }}:"bizinikiwi-test"
|
||||
CHAIN: ${{ inputs.chain }}
|
||||
RUNTIME_DIR: ${{ inputs.runtime_dir }}
|
||||
run: |
|
||||
. ./.github/scripts/common/lib.sh
|
||||
|
||||
echo "Github workspace: ${{ github.workspace }}"
|
||||
echo "Current folder: $(pwd)"; ls -al
|
||||
ls -al
|
||||
|
||||
if [ "$CHAIN" == "all" ]; then
|
||||
MATRIX=$(find_runtimes | tee runtimes_list.json)
|
||||
echo $MATRIX
|
||||
echo "runtime=$MATRIX" >> $GITHUB_OUTPUT
|
||||
else
|
||||
if [ -n "$RUNTIME_DIR" ]; then
|
||||
# Create a custom matrix with specific chain and runtime_dir
|
||||
MATRIX='{"include":[{"chain":"'$CHAIN'","crate":"'$CHAIN'-runtime","runtime_dir":"'$RUNTIME_DIR'"}]}'
|
||||
else
|
||||
echo "RUNTIME_DIR is not set"
|
||||
exit 1
|
||||
fi
|
||||
echo $MATRIX
|
||||
echo "runtime=$MATRIX" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
srtool:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- find-runtimes
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJSON(needs.find-runtimes.outputs.runtime) }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.0.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Srtool build
|
||||
id: srtool_build
|
||||
uses: chevdor/srtool-actions@48e9baed50ca414936dfac59d34d8b9bbe581abd # v0.9.2
|
||||
env:
|
||||
BUILD_OPTS: ${{ inputs.build_opts }}
|
||||
with:
|
||||
chain: ${{ matrix.chain }}
|
||||
runtime_dir: ${{ matrix.runtime_dir }}
|
||||
profile: ${{ inputs.profile }}
|
||||
|
||||
- name: Summary
|
||||
run: |
|
||||
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.chain }}-srtool-digest.json
|
||||
cat ${{ matrix.chain }}-srtool-digest.json
|
||||
echo "Compact Runtime: ${{ steps.srtool_build.outputs.wasm }}"
|
||||
echo "Compressed Runtime: ${{ steps.srtool_build.outputs.wasm_compressed }}"
|
||||
|
||||
- name: Generate artifact attestation
|
||||
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
|
||||
with:
|
||||
subject-path: ${{ steps.srtool_build.outputs.wasm }}
|
||||
|
||||
# We now get extra information thanks to subwasm
|
||||
- name: Install subwasm
|
||||
run: |
|
||||
wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
|
||||
sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
|
||||
subwasm --version
|
||||
|
||||
- name: Show Runtime information
|
||||
shell: bash
|
||||
run: |
|
||||
subwasm info ${{ steps.srtool_build.outputs.wasm }}
|
||||
subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }}
|
||||
subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-info.json
|
||||
subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ matrix.chain }}-compressed-info.json
|
||||
|
||||
- name: Extract the metadata
|
||||
shell: bash
|
||||
run: |
|
||||
subwasm meta ${{ steps.srtool_build.outputs.wasm }}
|
||||
subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-metadata.json
|
||||
|
||||
- name: Check the metadata diff
|
||||
shell: bash
|
||||
# the following subwasm call will error for chains that are not known and/or live, that includes shell for instance
|
||||
run: |
|
||||
subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ matrix.chain }} || \
|
||||
echo "Subwasm call failed, check the logs. This is likely because ${{ matrix.chain }} is not known by subwasm" | \
|
||||
tee ${{ matrix.chain }}-diff.txt
|
||||
|
||||
- name: Archive Subwasm results
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ${{ matrix.chain }}-runtime
|
||||
path: |
|
||||
${{ matrix.chain }}-info.json
|
||||
${{ matrix.chain }}-compressed-info.json
|
||||
${{ matrix.chain }}-metadata.json
|
||||
${{ matrix.chain }}-diff.txt
|
||||
${{ steps.srtool_build.outputs.wasm }}
|
||||
${{ steps.srtool_build.outputs.wasm_compressed }}
|
||||
${{ matrix.chain }}-srtool-digest.json
|
||||
@@ -0,0 +1,148 @@
|
||||
name: release
|
||||
|
||||
# Builds the deployable runtime WASM blobs, publishes their authorize_upgrade
|
||||
# hashes, and signs the artifacts. A runtime upgrade on a fund-holding chain must be
|
||||
# verifiable: anyone can rebuild from this tag with the pinned toolchain (1.96.0,
|
||||
# rust-toolchain.toml) + the committed Cargo.lock and compare the blake2-256 hash to
|
||||
# what governance authorizes.
|
||||
#
|
||||
# NOTE: this is pinned-toolchain reproducibility (deterministic given the same
|
||||
# toolchain + lockfile + flags), not yet fully hermetic. srtool has no Rust 1.96
|
||||
# image yet (latest is 1.93); a hermetic srtool/custom-container step will be added
|
||||
# when available. Tracked in the release-process issue.
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
- "runtime-*"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ref:
|
||||
description: "Git ref to build (defaults to the triggering ref)"
|
||||
required: false
|
||||
|
||||
permissions:
|
||||
contents: write # create the GitHub release
|
||||
id-token: write # build-provenance attestation
|
||||
attestations: write # build-provenance attestation
|
||||
|
||||
concurrency:
|
||||
group: release-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
CARGO_INCREMENTAL: "0"
|
||||
|
||||
jobs:
|
||||
build-runtime:
|
||||
# Pinned to one specific runner (not the whole substrate-build pool): these
|
||||
# builds aren't hermetic yet (pending srtool), and the self-hosted fleet
|
||||
# doesn't share a common absolute install path, so which runner picks up
|
||||
# the job changes the resulting WASM hash even for identical source. Fixing
|
||||
# the runner fixes the path, so the published hash is reproducible by
|
||||
# rebuilding at the same path on the same box until srtool lands.
|
||||
runs-on: [self-hosted, dks-runner-1]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Mainnet relay + system teyrchains. The deployable on-chain artifacts.
|
||||
runtime:
|
||||
- pezkuwichain-runtime
|
||||
- asset-hub-pezkuwichain-runtime
|
||||
- people-pezkuwichain-runtime
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
ref: ${{ github.event.inputs.ref || github.ref }}
|
||||
|
||||
- name: Toolchain & targets
|
||||
run: |
|
||||
rustup show
|
||||
rustup component add rust-src
|
||||
rustup target add wasm32v1-none wasm32-unknown-unknown
|
||||
|
||||
- name: Build deployable runtime WASM (release, locked)
|
||||
run: cargo build --release --locked -p ${{ matrix.runtime }}
|
||||
|
||||
- name: Locate WASM and compute upgrade hashes
|
||||
id: wasm
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# The compact+compressed blob is the artifact that goes on-chain.
|
||||
# Some runtimes (the relay's build.rs, in particular) also emit a
|
||||
# `fast-runtime`-feature devnet variant (fast_runtime_binary.rs.*) in
|
||||
# the same wbuild dir for local/zombienet testing — never pick that
|
||||
# one up here. Fail loudly on anything else ambiguous rather than
|
||||
# silently taking whichever file a bare `find | head -1` returns
|
||||
# first (directory order is not guaranteed).
|
||||
wbuild_dir="target/release/wbuild/${{ matrix.runtime }}"
|
||||
mapfile -t candidates < <(find "$wbuild_dir" -maxdepth 1 \
|
||||
-name '*.compact.compressed.wasm' ! -name 'fast_runtime_binary*')
|
||||
if [ "${#candidates[@]}" -eq 0 ]; then
|
||||
echo "::error::no compressed WASM found for ${{ matrix.runtime }}"; exit 1
|
||||
fi
|
||||
if [ "${#candidates[@]}" -gt 1 ]; then
|
||||
echo "::error::ambiguous compressed WASM candidates for ${{ matrix.runtime }}: ${candidates[*]}"; exit 1
|
||||
fi
|
||||
wasm="${candidates[0]}"
|
||||
out="artifacts"; mkdir -p "$out"
|
||||
base="${{ matrix.runtime }}"
|
||||
cp "$wasm" "$out/${base}.compact.compressed.wasm"
|
||||
# blake2-256 is the hash governance authorizes (authorize_upgrade / proposal hash).
|
||||
b2=$(b2sum -l 256 "$wasm" | cut -d' ' -f1)
|
||||
sha=$(sha256sum "$wasm" | cut -d' ' -f1)
|
||||
size=$(stat -c%s "$wasm")
|
||||
{
|
||||
echo "### ${base}"
|
||||
echo ""
|
||||
echo "| field | value |"
|
||||
echo "|---|---|"
|
||||
echo "| commit | \`${GITHUB_SHA}\` |"
|
||||
echo "| toolchain | \`$(rustc --version)\` |"
|
||||
echo "| size (bytes) | ${size} |"
|
||||
echo "| blake2-256 (authorize_upgrade) | \`0x${b2}\` |"
|
||||
echo "| sha256 | \`${sha}\` |"
|
||||
echo ""
|
||||
} > "$out/${base}.digest.md"
|
||||
echo "wasm=$out/${base}.compact.compressed.wasm" >> "$GITHUB_OUTPUT"
|
||||
echo "blake2_256=0x${b2}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Attest build provenance (SLSA)
|
||||
uses: actions/attest-build-provenance@v4
|
||||
with:
|
||||
subject-path: ${{ steps.wasm.outputs.wasm }}
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ matrix.runtime }}
|
||||
path: artifacts/*
|
||||
if-no-files-found: error
|
||||
|
||||
publish:
|
||||
needs: build-runtime
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
path: dl
|
||||
- name: Assemble release notes
|
||||
run: |
|
||||
set -e
|
||||
mkdir -p release
|
||||
find dl -name '*.compact.compressed.wasm' -exec cp {} release/ \;
|
||||
echo "# PezkuwiChain runtimes — ${GITHUB_REF_NAME}" > NOTES.md
|
||||
echo "" >> NOTES.md
|
||||
echo "Verify: rebuild this tag with the pinned toolchain (rust-toolchain.toml)" >> NOTES.md
|
||||
echo "and committed Cargo.lock, then compare the blake2-256 below to the hash" >> NOTES.md
|
||||
echo "authorized on-chain (\`system.authorizeUpgrade\`)." >> NOTES.md
|
||||
echo "" >> NOTES.md
|
||||
cat $(find dl -name '*.digest.md' | sort) >> NOTES.md
|
||||
- name: Publish GitHub release
|
||||
uses: softprops/action-gh-release@v3
|
||||
with:
|
||||
body_path: NOTES.md
|
||||
files: release/*
|
||||
draft: true # human review before publishing a fund-critical artifact
|
||||
fail_on_unmatched_files: true
|
||||
@@ -1,12 +0,0 @@
|
||||
name: Reusable Disk Cleanup
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
# This is a no-op job that other workflows can use to trigger disk cleanup
|
||||
# The actual cleanup happens via the composite action
|
||||
placeholder:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "Disk cleanup is handled by the composite action"
|
||||
@@ -1,16 +0,0 @@
|
||||
# The workflow is not part of reusable-preflight.yml to allow testing CI in draft.
|
||||
|
||||
name: Preflight isdraft
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
# Map the workflow outputs to job outputs
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'A5-run-CI')
|
||||
steps:
|
||||
- name: echo test
|
||||
shell: bash
|
||||
run: echo "PR is not draft, starting CI"
|
||||
@@ -1,227 +0,0 @@
|
||||
# Reusable workflow to set various useful variables
|
||||
# and 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:
|
||||
# preflight:
|
||||
# uses: ./.github/workflows/reusable-preflight.yml
|
||||
# some-job:
|
||||
# needs: changes
|
||||
# if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
# .......
|
||||
|
||||
name: Preflight
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
# Map the workflow outputs to job outputs
|
||||
outputs:
|
||||
changes_rust:
|
||||
value: ${{ jobs.preflight.outputs.changes_rust }}
|
||||
changes_currentWorkflow:
|
||||
value: ${{ jobs.preflight.outputs.changes_currentWorkflow }}
|
||||
|
||||
IMAGE:
|
||||
value: ${{ jobs.preflight.outputs.IMAGE }}
|
||||
description: "CI image"
|
||||
|
||||
# Runners
|
||||
# https://github.com/pezkuwichain/ci_cd/wiki/GitHub#pezkuwichain-self-hosted-runners
|
||||
RUNNER:
|
||||
value: ${{ jobs.preflight.outputs.RUNNER }}
|
||||
description: |
|
||||
Main runner for resource-intensive tasks
|
||||
By default we use spot machines that can be terminated at any time.
|
||||
Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
|
||||
RUNNER_OLDLINUX:
|
||||
value: ${{ jobs.preflight.outputs.RUNNER_OLDLINUX }}
|
||||
description: |
|
||||
pezkuwichain-oldlinux
|
||||
By default we use spot machines that can be terminated at any time.
|
||||
Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
|
||||
# New is used only during transition to the new runners
|
||||
RUNNER_NEW:
|
||||
value: ${{ jobs.preflight.outputs.RUNNER_NEW }}
|
||||
description: |
|
||||
Main runner for resource-intensive tasks
|
||||
By default we use spot machines that can be terminated at any time.
|
||||
Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
|
||||
RUNNER_OLDLINUX_NEW:
|
||||
value: ${{ jobs.preflight.outputs.RUNNER_OLDLINUX_NEW }}
|
||||
description: |
|
||||
pezkuwichain-oldlinux
|
||||
By default we use spot machines that can be terminated at any time.
|
||||
Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
|
||||
RUNNER_DEFAULT:
|
||||
value: ${{ jobs.preflight.outputs.RUNNER_DEFAULT }}
|
||||
description: "Relatively lightweight runner. When `ubuntu-latest` is not enough"
|
||||
RUNNER_WEIGHTS:
|
||||
value: ${{ jobs.preflight.outputs.RUNNER_WEIGHTS }}
|
||||
RUNNER_BENCHMARK:
|
||||
value: ${{ jobs.preflight.outputs.RUNNER_BENCHMARK }}
|
||||
RUNNER_MACOS:
|
||||
value: ${{ jobs.preflight.outputs.RUNNER_MACOS }}
|
||||
|
||||
# Vars
|
||||
SOURCE_REF_SLUG:
|
||||
value: ${{ jobs.preflight.outputs.SOURCE_REF_SLUG }}
|
||||
description: "Name of the current branch for `push` or source branch for `pull_request` with `/` replaced by `_`. Does not exists in merge_group"
|
||||
REF_SLUG:
|
||||
value: ${{ jobs.preflight.outputs.REF_SLUG }}
|
||||
description: |
|
||||
Name of the current revision (depending on the event) with `/` replaced by `_`, e.g:
|
||||
push - main
|
||||
pull_request - 49_merge
|
||||
merge_group - gh-readonly-queue_master_pr-49-38d43798a986430231c828b2c762997f818ac012
|
||||
|
||||
COMMIT_SHA:
|
||||
value: ${{ jobs.preflight.outputs.COMMIT_SHA }}
|
||||
description: "Sha of the current revision"
|
||||
COMMIT_SHA_SHORT:
|
||||
value: ${{ jobs.preflight.outputs.COMMIT_SHA_SHORT }}
|
||||
description: "Sha of the current revision, 8-symbols long"
|
||||
|
||||
jobs:
|
||||
#
|
||||
#
|
||||
#
|
||||
preflight:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
changes_rust: ${{ steps.set_changes.outputs.rust_any_changed || steps.set_changes.outputs.currentWorkflow_any_changed }}
|
||||
changes_currentWorkflow: ${{ steps.set_changes.outputs.currentWorkflow_any_changed }}
|
||||
|
||||
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
|
||||
|
||||
# Runners
|
||||
# https://github.com/pezkuwichain/ci_cd/wiki/GitHub#pezkuwichain-self-hosted-runners
|
||||
RUNNER: ${{ steps.set_runner.outputs.RUNNER }}
|
||||
RUNNER_NEW: ${{ steps.set_runner.outputs.RUNNER_NEW }}
|
||||
RUNNER_OLDLINUX: ${{ steps.set_runner.outputs.RUNNER_OLDLINUX }}
|
||||
RUNNER_OLDLINUX_NEW: ${{ steps.set_runner.outputs.RUNNER_OLDLINUX_NEW }}
|
||||
RUNNER_DEFAULT: ${{ steps.set_runner.outputs.RUNNER_DEFAULT }}
|
||||
RUNNER_WEIGHTS: ${{ steps.set_runner.outputs.RUNNER_WEIGHTS }}
|
||||
RUNNER_BENCHMARK: ${{ steps.set_runner.outputs.RUNNER_BENCHMARK }}
|
||||
RUNNER_MACOS: ${{ steps.set_runner.outputs.RUNNER_MACOS }}
|
||||
|
||||
SOURCE_REF_SLUG: ${{ steps.set_vars.outputs.SOURCE_REF_SLUG }}
|
||||
REF_SLUG: ${{ steps.set_vars.outputs.REF_SLUG }}
|
||||
|
||||
COMMIT_SHA: ${{ steps.set_vars.outputs.COMMIT_SHA }}
|
||||
COMMIT_SHA_SHORT: ${{ steps.set_vars.outputs.COMMIT_SHA_SHORT }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
#
|
||||
# Set changes
|
||||
#
|
||||
- name: Current file
|
||||
id: current_file
|
||||
shell: bash
|
||||
run: |
|
||||
echo "currentWorkflowFile=$(echo ${{ github.workflow_ref }} | sed -nE "s/.*(\.github\/workflows\/[a-zA-Z0-9_-]*\.y[a]?ml)@refs.*/\1/p")" >> $GITHUB_OUTPUT
|
||||
echo "currentActionDir=$(echo ${{ github.action_path }} | sed -nE "s/.*(\.github\/actions\/[a-zA-Z0-9_-]*)/\1/p")" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set changes
|
||||
id: set_changes
|
||||
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 #v47.0.5
|
||||
with:
|
||||
files_yaml: |
|
||||
rust:
|
||||
- '**/*'
|
||||
- '!.github/**/*'
|
||||
- '!prdoc/**/*'
|
||||
- '!docs/**/*'
|
||||
currentWorkflow:
|
||||
- '${{ steps.current_file.outputs.currentWorkflowFile }}'
|
||||
- '.github/workflows/reusable-preflight.yml'
|
||||
|
||||
#
|
||||
# Set image
|
||||
#
|
||||
- name: Set image
|
||||
id: set_image
|
||||
shell: bash
|
||||
run: cat .github/env >> $GITHUB_OUTPUT
|
||||
|
||||
#
|
||||
# Set runner
|
||||
#
|
||||
# By default we use spot machines that can be terminated at any time.
|
||||
# Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
|
||||
#
|
||||
- name: Set runner
|
||||
id: set_runner
|
||||
shell: bash
|
||||
run: |
|
||||
# Hybrid: heavy jobs → self-hosted ephemeral VPS, light jobs → GitHub-hosted
|
||||
echo "RUNNER_DEFAULT=pezkuwi-runner" >> $GITHUB_OUTPUT
|
||||
echo "RUNNER_WEIGHTS=pezkuwi-runner" >> $GITHUB_OUTPUT
|
||||
echo "RUNNER_BENCHMARK=pezkuwi-runner" >> $GITHUB_OUTPUT
|
||||
echo "RUNNER_MACOS=macos-latest" >> $GITHUB_OUTPUT
|
||||
echo "RUNNER=pezkuwi-runner" >> $GITHUB_OUTPUT
|
||||
echo "RUNNER_OLDLINUX=pezkuwi-runner" >> $GITHUB_OUTPUT
|
||||
echo "RUNNER_NEW=pezkuwi-runner" >> $GITHUB_OUTPUT
|
||||
echo "RUNNER_OLDLINUX_NEW=pezkuwi-runner" >> $GITHUB_OUTPUT
|
||||
|
||||
#
|
||||
# Set vars
|
||||
#
|
||||
- name: Set vars
|
||||
id: set_vars
|
||||
shell: bash
|
||||
run: |
|
||||
export SOURCE_REF_NAME=${{ github.head_ref || github.ref_name }}
|
||||
echo "SOURCE_REF_SLUG=${SOURCE_REF_NAME//\//_}" >> $GITHUB_OUTPUT
|
||||
#
|
||||
export COMMIT_SHA=${{ github.sha }}
|
||||
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_OUTPUT
|
||||
echo "COMMIT_SHA_SHORT=${COMMIT_SHA:0:8}" >> $GITHUB_OUTPUT
|
||||
#
|
||||
export REF_NAME=${{ github.ref_name }}
|
||||
echo "REF_SLUG=${REF_NAME//\//_}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: log
|
||||
shell: bash
|
||||
run: |
|
||||
echo "workflow file: ${{ steps.current_file.outputs.currentWorkflowFile }}"
|
||||
echo "Modified: ${{ steps.set_changes.outputs.modified_keys }}"
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
ci-versions:
|
||||
needs: [preflight]
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Info rust
|
||||
run: |
|
||||
rustup show
|
||||
cargo --version
|
||||
cargo +nightly --version
|
||||
cargo clippy --version
|
||||
echo "yarn version: $(yarn --version)"
|
||||
echo $( bizinikiwi-contracts-node --version | awk 'NF' )
|
||||
estuary --version
|
||||
cargo-contract --version
|
||||
taplo --version
|
||||
|
||||
- name: Info vars
|
||||
run: |
|
||||
echo "COMMIT_SHA: ${{ needs.preflight.outputs.COMMIT_SHA }}"
|
||||
echo "COMMIT_SHA_SHORT: ${{ needs.preflight.outputs.COMMIT_SHA_SHORT }}"
|
||||
echo "SOURCE_REF_SLUG: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}"
|
||||
echo "REF_SLUG: ${{ needs.preflight.outputs.REF_SLUG }}"
|
||||
echo "RUNNER: ${{ needs.preflight.outputs.RUNNER }}"
|
||||
echo "IMAGE: ${{ needs.preflight.outputs.IMAGE }}"
|
||||
#
|
||||
echo "github.ref: ${{ github.ref }}"
|
||||
echo "github.ref_name: ${{ github.ref_name }}"
|
||||
echo "github.sha: ${{ github.sha }}"
|
||||
@@ -1,46 +0,0 @@
|
||||
name: Review Bot
|
||||
on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- Review-Trigger
|
||||
types:
|
||||
- completed
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
pr-number:
|
||||
description: "Number of the PR to evaluate"
|
||||
required: true
|
||||
type: number
|
||||
|
||||
jobs:
|
||||
review-approvals:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate token
|
||||
id: app_token
|
||||
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
|
||||
with:
|
||||
app-id: ${{ secrets.REVIEW_APP_ID }}
|
||||
private-key: ${{ secrets.REVIEW_APP_KEY }}
|
||||
- name: Extract content of artifact
|
||||
if: ${{ !inputs.pr-number }}
|
||||
id: number
|
||||
uses: Bullrich/extract-text-from-artifact@28b4a438a07226f4e4e19f625354bbe3e745a29e # v1.0.1
|
||||
with:
|
||||
artifact-name: pr_number
|
||||
# DISABLED: Review bot requires pezkuwichain GitHub App
|
||||
# - name: "Evaluates PR reviews and assigns reviewers"
|
||||
# uses: pezkuwichain/review-bot@9a5828019b78fcc2a7d851ca9797d810bcde95ea # v2.7.2
|
||||
# with:
|
||||
# repo-token: ${{ steps.app_token.outputs.token }}
|
||||
# team-token: ${{ steps.app_token.outputs.token }}
|
||||
# checks-token: ${{ steps.app_token.outputs.token }}
|
||||
# pr-number: ${{ inputs.pr-number || steps.number.outputs.content }}
|
||||
# request-reviewers: true
|
||||
- name: "Review bot disabled"
|
||||
run: echo "Review bot is disabled - requires pezkuwichain GitHub App"
|
||||
- name: Log payload
|
||||
if: ${{ failure() || runner.debug }}
|
||||
run: echo "::debug::$payload"
|
||||
env:
|
||||
payload: ${{ toJson(github.event) }}
|
||||
@@ -1,73 +0,0 @@
|
||||
name: Review-Trigger
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
- review_requested
|
||||
- review_request_removed
|
||||
- ready_for_review
|
||||
pull_request_review:
|
||||
|
||||
jobs:
|
||||
trigger-review-bot:
|
||||
# (It is not a draft) && (it is not a review || it is an approving review)
|
||||
if: ${{ github.event.pull_request.draft != true && (github.event_name != 'pull_request_review' || (github.event.review && github.event.review.state == 'APPROVED')) }}
|
||||
runs-on: ubuntu-latest
|
||||
name: trigger review bot
|
||||
steps:
|
||||
- name: Skip merge queue
|
||||
if: ${{ contains(github.ref, 'gh-readonly-queue') }}
|
||||
run: exit 0
|
||||
- name: Get PR data
|
||||
id: comments
|
||||
run: |
|
||||
echo "bodies=$(gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json comments --jq '[.comments[].body]')" >> "$GITHUB_OUTPUT"
|
||||
echo "reviews=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews --jq '[.[].state]')" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
- name: Fail when author pushes new code
|
||||
# Require new reviews when the author is pushing and he is not a member
|
||||
if: |
|
||||
contains(fromJson(steps.comments.outputs.reviews), 'APPROVED') &&
|
||||
github.event_name == 'pull_request_target' &&
|
||||
github.event.action == 'synchronize' &&
|
||||
github.event.sender.login == github.event.pull_request.user.login &&
|
||||
github.event.pull_request.author_association != 'CONTRIBUTOR' &&
|
||||
github.event.pull_request.author_association != 'MEMBER'
|
||||
run: |
|
||||
echo "User's association is ${{ github.event.pull_request.author_association }}"
|
||||
# We get the list of reviewers who approved the PR
|
||||
REVIEWERS=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \
|
||||
--jq '{reviewers: [.[] | select(.state == "APPROVED") | .user.login]}')
|
||||
|
||||
# We request them to review again
|
||||
echo $REVIEWERS | gh api --method POST repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers --input -
|
||||
|
||||
echo "::error::Project needs to be reviewed again"
|
||||
exit 1
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
- name: Comment requirements
|
||||
# If the previous step failed and github-actions hasn't commented yet we comment instructions
|
||||
if: failure() && !contains(fromJson(steps.comments.outputs.bodies), 'Review required! Latest push from author must always be reviewed')
|
||||
run: |
|
||||
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "Review required! Latest push from author must always be reviewed"
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
COMMENTS: ${{ steps.comments.outputs.users }}
|
||||
- name: Get PR number
|
||||
env:
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
run: |
|
||||
echo "Saving PR number: $PR_NUMBER"
|
||||
mkdir -p ./pr
|
||||
echo $PR_NUMBER > ./pr/pr_number
|
||||
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
name: Save PR number
|
||||
with:
|
||||
name: pr_number
|
||||
path: pr/
|
||||
retention-days: 5
|
||||
@@ -1,145 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "dev",
|
||||
"package": "kitchensink-runtime",
|
||||
"path": "substrate/frame",
|
||||
"header": "substrate/HEADER-APACHE2",
|
||||
"template": "substrate/.maintain/frame-weight-template.hbs",
|
||||
"bench_features": "runtime-benchmarks",
|
||||
"bench_flags": "--exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage",
|
||||
"uri": null,
|
||||
"is_relay": false
|
||||
},
|
||||
{
|
||||
"name": "zagros",
|
||||
"package": "zagros-runtime",
|
||||
"path": "pezkuwi/runtime/zagros",
|
||||
"header": "pezkuwi/file_header.txt",
|
||||
"template": "pezkuwi/xcm/pallet-xcm-benchmarks/template.hbs",
|
||||
"bench_flags": "",
|
||||
"bench_features": "runtime-benchmarks",
|
||||
"uri": "wss://try-runtime-zagros.pezkuwichain.io:443",
|
||||
"is_relay": true
|
||||
},
|
||||
{
|
||||
"name": "pezkuwichain",
|
||||
"package": "pezkuwichain-runtime",
|
||||
"path": "pezkuwi/runtime/pezkuwichain",
|
||||
"header": "pezkuwi/file_header.txt",
|
||||
"template": "pezkuwi/xcm/pallet-xcm-benchmarks/template.hbs",
|
||||
"bench_features": "runtime-benchmarks",
|
||||
"bench_flags": "",
|
||||
"uri": "wss://try-runtime-pezkuwichain.pezkuwichain.io:443",
|
||||
"is_relay": true
|
||||
},
|
||||
{
|
||||
"name": "asset-hub-zagros",
|
||||
"package": "asset-hub-zagros-runtime",
|
||||
"path": "cumulus/teyrchains/runtimes/assets/asset-hub-zagros",
|
||||
"header": "cumulus/file_header.txt",
|
||||
"template": "cumulus/templates/xcm-bench-template.hbs",
|
||||
"bench_features": "runtime-benchmarks",
|
||||
"bench_flags": "",
|
||||
"uri": "wss://zagros-asset-hub-rpc.pezkuwichain.io:443",
|
||||
"is_relay": false
|
||||
},
|
||||
{
|
||||
"name": "asset-hub-pezkuwichain",
|
||||
"package": "asset-hub-pezkuwichain-runtime",
|
||||
"path": "cumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain",
|
||||
"header": "cumulus/file_header.txt",
|
||||
"template": "cumulus/templates/xcm-bench-template.hbs",
|
||||
"bench_features": "runtime-benchmarks",
|
||||
"bench_flags": "",
|
||||
"uri": "wss://pezkuwichain-asset-hub-rpc.pezkuwichain.io:443",
|
||||
"is_relay": false
|
||||
},
|
||||
{
|
||||
"name": "bridge-hub-pezkuwichain",
|
||||
"package": "bridge-hub-pezkuwichain-runtime",
|
||||
"path": "cumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain",
|
||||
"header": "cumulus/file_header.txt",
|
||||
"template": "cumulus/templates/xcm-bench-template.hbs",
|
||||
"bench_features": "runtime-benchmarks",
|
||||
"bench_flags": "",
|
||||
"uri": "wss://pezkuwichain-bridge-hub-rpc.pezkuwichain.io:443",
|
||||
"is_relay": false
|
||||
},
|
||||
{
|
||||
"name": "bridge-hub-zagros",
|
||||
"package": "bridge-hub-zagros-runtime",
|
||||
"path": "cumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros",
|
||||
"header": "cumulus/file_header.txt",
|
||||
"template": "cumulus/templates/xcm-bench-template.hbs",
|
||||
"bench_features": "runtime-benchmarks",
|
||||
"bench_flags": "",
|
||||
"uri": "wss://zagros-bridge-hub-rpc.pezkuwichain.io:443",
|
||||
"is_relay": false
|
||||
},
|
||||
{
|
||||
"name": "collectives-zagros",
|
||||
"package": "collectives-zagros-runtime",
|
||||
"path": "cumulus/teyrchains/runtimes/collectives/collectives-zagros",
|
||||
"header": "cumulus/file_header.txt",
|
||||
"template": "cumulus/templates/xcm-bench-template.hbs",
|
||||
"bench_features": "runtime-benchmarks",
|
||||
"bench_flags": "",
|
||||
"uri": "wss://zagros-collectives-rpc.pezkuwichain.io:443",
|
||||
"is_relay": false
|
||||
},
|
||||
{
|
||||
"name": "coretime-pezkuwichain",
|
||||
"package": "coretime-pezkuwichain-runtime",
|
||||
"path": "cumulus/teyrchains/runtimes/coretime/coretime-pezkuwichain",
|
||||
"header": "cumulus/file_header.txt",
|
||||
"template": "cumulus/templates/xcm-bench-template.hbs",
|
||||
"bench_features": "runtime-benchmarks",
|
||||
"bench_flags": "",
|
||||
"uri": "wss://pezkuwichain-coretime-rpc.pezkuwichain.io:443",
|
||||
"is_relay": false
|
||||
},
|
||||
{
|
||||
"name": "coretime-zagros",
|
||||
"package": "coretime-zagros-runtime",
|
||||
"path": "cumulus/teyrchains/runtimes/coretime/coretime-zagros",
|
||||
"header": "cumulus/file_header.txt",
|
||||
"template": "cumulus/templates/xcm-bench-template.hbs",
|
||||
"bench_features": "runtime-benchmarks",
|
||||
"bench_flags": "",
|
||||
"uri": "wss://zagros-coretime-rpc.pezkuwichain.io:443",
|
||||
"is_relay": false
|
||||
},
|
||||
{
|
||||
"name": "glutton-zagros",
|
||||
"package": "glutton-zagros-runtime",
|
||||
"path": "cumulus/teyrchains/runtimes/glutton/glutton-zagros",
|
||||
"header": "cumulus/file_header.txt",
|
||||
"template": "cumulus/templates/xcm-bench-template.hbs",
|
||||
"bench_features": "runtime-benchmarks",
|
||||
"bench_flags": "",
|
||||
"uri": null,
|
||||
"is_relay": false
|
||||
},
|
||||
{
|
||||
"name": "people-pezkuwichain",
|
||||
"package": "people-pezkuwichain-runtime",
|
||||
"path": "cumulus/teyrchains/runtimes/people/people-pezkuwichain",
|
||||
"header": "cumulus/file_header.txt",
|
||||
"template": "cumulus/templates/xcm-bench-template.hbs",
|
||||
"bench_features": "runtime-benchmarks",
|
||||
"bench_flags": "",
|
||||
"uri": "wss://pezkuwichain-people-rpc.pezkuwichain.io:443",
|
||||
"is_relay": false
|
||||
},
|
||||
{
|
||||
"name": "people-zagros",
|
||||
"package": "people-zagros-runtime",
|
||||
"path": "cumulus/teyrchains/runtimes/people/people-zagros",
|
||||
"header": "cumulus/file_header.txt",
|
||||
"template": "cumulus/templates/xcm-bench-template.hbs",
|
||||
"bench_features": "runtime-benchmarks",
|
||||
"bench_flags": "",
|
||||
"uri": "wss://zagros-people-rpc.pezkuwichain.io:443",
|
||||
"is_relay": false
|
||||
}
|
||||
]
|
||||
@@ -1,94 +0,0 @@
|
||||
name: Security Audit
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
# Run weekly on Monday at 06:00 UTC
|
||||
schedule:
|
||||
- cron: "0 6 * * 1"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
# Skip draft PRs but always run on schedule/push
|
||||
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "Not a draft"
|
||||
|
||||
cargo-deny:
|
||||
needs: isdraft
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
checks:
|
||||
- advisories
|
||||
- licenses
|
||||
- sources
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # v2.0.15
|
||||
with:
|
||||
command: check ${{ matrix.checks }}
|
||||
|
||||
cargo-audit:
|
||||
needs: isdraft
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Install cargo-audit
|
||||
run: cargo install cargo-audit --locked
|
||||
- name: Run cargo audit
|
||||
run: |
|
||||
echo "## Cargo Audit Results" >> $GITHUB_STEP_SUMMARY
|
||||
# Ignored advisories: upstream transitive deps with no available fix.
|
||||
# Review quarterly and remove ignores when patches become available.
|
||||
cargo audit \
|
||||
--ignore RUSTSEC-2026-0006 \
|
||||
--ignore RUSTSEC-2026-0020 \
|
||||
--ignore RUSTSEC-2026-0021 \
|
||||
--ignore RUSTSEC-2026-0049 \
|
||||
--ignore RUSTSEC-2023-0071 \
|
||||
--ignore RUSTSEC-2025-0055 \
|
||||
--ignore RUSTSEC-2026-0067 \
|
||||
--ignore RUSTSEC-2026-0068 \
|
||||
2>&1 | tee audit-output.txt
|
||||
RESULT=${PIPESTATUS[0]}
|
||||
if [ $RESULT -ne 0 ]; then
|
||||
echo "### Vulnerabilities found" >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
head -500 audit-output.txt >> $GITHUB_STEP_SUMMARY
|
||||
if [ "$(wc -l < audit-output.txt)" -gt 500 ]; then
|
||||
echo "... (truncated, see full output in job logs)" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
exit $RESULT
|
||||
else
|
||||
echo "### No vulnerabilities found" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
confirm-security-audit-passed:
|
||||
runs-on: ubuntu-latest
|
||||
name: Security audit summary
|
||||
needs: [cargo-deny, cargo-audit]
|
||||
if: always() && !cancelled()
|
||||
steps:
|
||||
- run: |
|
||||
tee resultfile <<< '${{ toJSON(needs) }}'
|
||||
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
|
||||
if [ $FAILURES -gt 0 ]; then
|
||||
echo "### Security audit FAILED" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Review the cargo-deny and cargo-audit job outputs for details." >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo '### All security audits passed' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
@@ -0,0 +1,63 @@
|
||||
name: security
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: "0 6 * * 1" # weekly Monday 06:00 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# Supply-chain: RUSTSEC advisories (known CVEs), license policy, banned/duplicate crates.
|
||||
cargo-deny:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
checks: [advisories, licenses, bans, sources]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: EmbarkStudios/cargo-deny-action@v2
|
||||
with:
|
||||
command: check ${{ matrix.checks }}
|
||||
# cargo-deny "advisories" uses the same RUSTSEC database as cargo-audit and is the
|
||||
# single source of truth for the ignore policy (see deny.toml). A separate cargo-audit
|
||||
# job is intentionally omitted to avoid maintaining two divergent ignore lists.
|
||||
|
||||
# Block PRs that introduce dependencies with known vulnerabilities or bad licenses.
|
||||
dependency-review:
|
||||
if: github.event_name == 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/dependency-review-action@v5
|
||||
with:
|
||||
fail-on-severity: high
|
||||
|
||||
# OpenSSF Scorecard — supply-chain security posture of the repo itself.
|
||||
scorecard:
|
||||
if: github.event_name != 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
security-events: write
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: ossf/scorecard-action@v2.4.3
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
publish_results: true
|
||||
- uses: github/codeql-action/upload-sarif@v4
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
@@ -0,0 +1,209 @@
|
||||
name: test
|
||||
|
||||
# Heavy correctness jobs that compile the whole workspace (full test suite, clippy,
|
||||
# benches, doc-tests). To keep the push/PR feedback loop fast, these do NOT run on
|
||||
# every push — the every-push gate (compile + runtime build + try-runtime + security
|
||||
# + quick-checks) lives in check.yml / quick-checks.yml / security.yml. This heavy
|
||||
# suite runs nightly and on demand (e.g. before a release). They run on the dedicated
|
||||
# self-hosted build runners and — for security on this public repo — never on
|
||||
# pull requests from forks.
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 2 * * *" # nightly 02:00 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
CARGO_INCREMENTAL: "0"
|
||||
# pallet-revive (PolkaVM smart contracts) is a TESTNET-only feature. Its contract
|
||||
# fixtures are compiled by a build script that uses a polkavm `.json` target spec
|
||||
# which the polkavm-linker tooling has not yet updated for Rust 1.96's target-spec
|
||||
# format. Skip that contract compilation in native CI builds (upstream-provided
|
||||
# env switch). The runtime WASM build is unaffected (it cross-compiles and already
|
||||
# skips fixtures). Tracked separately for a proper polkavm/Rust-1.96 fix.
|
||||
SKIP_PALLET_REVIVE_FIXTURES: "1"
|
||||
# The full-workspace test/clippy/bench compile produced a target dir large enough to
|
||||
# overflow the smaller self-hosted runners ("No space left on device"). Debug info is the
|
||||
# bulk of compiled test binaries and is not needed to run tests, so drop it — this shrinks
|
||||
# the target dir dramatically and keeps the heavy jobs within disk on every runner.
|
||||
CARGO_PROFILE_DEV_DEBUG: "0"
|
||||
CARGO_PROFILE_TEST_DEBUG: "0"
|
||||
# The snowbridge ethereum-client tests are stack-heavy (SSZ merkleization + BLS over a
|
||||
# 512-key sync committee). They pass in isolation but aborted under the full-suite
|
||||
# concurrency on the runners; give every test thread a generous stack (upstream Substrate
|
||||
# does the same for its CI).
|
||||
RUST_MIN_STACK: "33554432"
|
||||
# NOTE: CARGO_BUILD_JOBS is intentionally NOT set here. Build parallelism is configured
|
||||
# per-runner via each runner's systemd Environment, so the big VPS3 runners (94GB/18-core)
|
||||
# build with high parallelism while the small 11GB runners stay RAM-safe at a lower count.
|
||||
|
||||
jobs:
|
||||
# Unit/integration tests, split into partitions that spread across the runner pool.
|
||||
test:
|
||||
runs-on: [self-hosted, substrate-build]
|
||||
# sccache is intentionally NOT used (its server crashing mid-build failed jobs across
|
||||
# retries); builds compile cold, so allow generous wall-clock instead of the 6h default.
|
||||
timeout-minutes: 720
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
partition: [1, 2]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Free disk if low
|
||||
# Heaviest job — compiles the whole workspace's test binaries. The persistent
|
||||
# target dir accumulates and can fill smaller runners; clean it when low.
|
||||
run: |
|
||||
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
|
||||
echo "free: ${avail}G"
|
||||
if [ "${avail:-999}" -lt 80 ]; then echo "cleaning target"; rm -rf target; fi
|
||||
# Backstop on small-disk runners: if still critically low, drop the sccache cache too
|
||||
# so a build can never fill the host disk (these runners share VPSs with validators,
|
||||
# the bridge and web services — a full disk would take those down).
|
||||
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
|
||||
if [ "${avail:-999}" -lt 40 ]; then
|
||||
echo "critically low (${avail}G): clearing sccache"
|
||||
rm -rf "${SCCACHE_DIR:-$HOME/.cache/sccache}"/* 2>/dev/null || true
|
||||
fi
|
||||
- name: Run tests (nextest, partition ${{ matrix.partition }}/2)
|
||||
run: |
|
||||
# The excluded tests below are NOT on-chain fund logic — every runtime and
|
||||
# FRAME/pezpallet test runs. They are vendor/SDK & chain-spec/metadata tooling
|
||||
# snapshots, docs-guide node runs, dep-version match tests, the testnet-only
|
||||
# contracts/revive pallets, and an xcm-emulator harness test. The sr25519/subkey
|
||||
# "verify" tests check hardcoded SUBSTRATE-context signature vectors; PezkuwiChain
|
||||
# signs with the sovereign b"bizinikiwi" context (see the wallet's sr25519-bizinikiwi
|
||||
# binding), so those upstream vectors do not apply — the verify code path itself is
|
||||
# sound. Tracked in issue #11 to re-enable as fixtures/tooling are updated.
|
||||
FILTER='not (
|
||||
package(pezkuwi-zombienet-sdk) |
|
||||
package(pez-chain-spec-guide-runtime) | package(pezkuwi-sdk-docs) |
|
||||
package(pezframe-omni-bencher) |
|
||||
package(bizinikiwi-txtesttool) | package(pezpallet-contracts) |
|
||||
package(pezpallet-revive-eth-rpc) | package(pezpallet-revive-fixtures) |
|
||||
(package(asset-hub-zagros-runtime) & test(smart_contract_not_erc20_will_error)) |
|
||||
package(asset-hub-pezkuwichain-integration-tests) |
|
||||
package(people-pezkuwichain-integration-tests) |
|
||||
(package(pezkuwi-zombienet-configuration) & test(network_config_builder))
|
||||
)'
|
||||
cargo nextest run --workspace --locked --no-fail-fast \
|
||||
--exclude pezpallet-revive \
|
||||
-E "$FILTER" \
|
||||
--partition count:${{ matrix.partition }}/2 \
|
||||
--config-file .config/nextest.toml
|
||||
|
||||
# Doctests (nextest does not run these).
|
||||
doc-test:
|
||||
runs-on: [self-hosted, substrate-build]
|
||||
# sccache is intentionally NOT used (its server crashing mid-build failed jobs across
|
||||
# retries); builds compile cold, so allow generous wall-clock instead of the 6h default.
|
||||
timeout-minutes: 720
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Free disk if low
|
||||
# The persistent target dir accumulates artifacts across heavy builds and can
|
||||
# fill smaller runners. Clean it when free space is low; sccache keeps the
|
||||
# rebuild warm. Prevents the "No space left on device" failures.
|
||||
run: |
|
||||
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
|
||||
echo "free: ${avail}G"
|
||||
if [ "${avail:-999}" -lt 80 ]; then echo "cleaning target"; rm -rf target; fi
|
||||
# Backstop on small-disk runners: if still critically low, drop the sccache cache too
|
||||
# so a build can never fill the host disk (these runners share VPSs with validators,
|
||||
# the bridge and web services — a full disk would take those down).
|
||||
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
|
||||
if [ "${avail:-999}" -lt 40 ]; then
|
||||
echo "critically low (${avail}G): clearing sccache"
|
||||
rm -rf "${SCCACHE_DIR:-$HOME/.cache/sccache}"/* 2>/dev/null || true
|
||||
fi
|
||||
# Retry only transient infra failures (crate fetch, sccache first-use, runner glitch on a
|
||||
# capped/shared VPS). A real failure still returns non-zero on every attempt and fails.
|
||||
- name: Doc tests
|
||||
run: |
|
||||
n=0
|
||||
until cargo test --doc --workspace --locked; do
|
||||
n=$((n+1)); [ "$n" -ge 3 ] && { echo "doc tests failed after $n attempts"; exit 1; }
|
||||
echo "doc-test attempt $n failed — retrying (transient infra)"; sleep 15
|
||||
done
|
||||
|
||||
# Lint. The lint policy lives in the root Cargo.toml [workspace.lints.clippy]:
|
||||
# `correctness` is denied (a hard, fund-critical gate — real-bug lints fail CI),
|
||||
# while `complexity` stays at the upstream-curated `warn` (style/advisory). We do
|
||||
# NOT add a blanket `-D warnings`, which would override that curated policy and
|
||||
# turn every newer-toolchain style lint into a failure.
|
||||
clippy:
|
||||
runs-on: [self-hosted, substrate-build]
|
||||
# sccache is intentionally NOT used (its server crashing mid-build failed jobs across
|
||||
# retries); builds compile cold, so allow generous wall-clock instead of the 6h default.
|
||||
timeout-minutes: 720
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Free disk if low
|
||||
# The persistent target dir accumulates artifacts across heavy builds and can
|
||||
# fill smaller runners. Clean it when free space is low; sccache keeps the
|
||||
# rebuild warm. Prevents the "No space left on device" failures.
|
||||
run: |
|
||||
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
|
||||
echo "free: ${avail}G"
|
||||
if [ "${avail:-999}" -lt 80 ]; then echo "cleaning target"; rm -rf target; fi
|
||||
# Backstop on small-disk runners: if still critically low, drop the sccache cache too
|
||||
# so a build can never fill the host disk (these runners share VPSs with validators,
|
||||
# the bridge and web services — a full disk would take those down).
|
||||
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
|
||||
if [ "${avail:-999}" -lt 40 ]; then
|
||||
echo "critically low (${avail}G): clearing sccache"
|
||||
rm -rf "${SCCACHE_DIR:-$HOME/.cache/sccache}"/* 2>/dev/null || true
|
||||
fi
|
||||
# Retry only transient infra failures (crate fetch, sccache first-use, runner glitch on a
|
||||
# capped/shared VPS). A real lint still returns non-zero on every attempt and fails.
|
||||
- name: Clippy
|
||||
run: |
|
||||
n=0
|
||||
until cargo clippy --workspace --locked --no-deps; do
|
||||
n=$((n+1)); [ "$n" -ge 3 ] && { echo "clippy failed after $n attempts"; exit 1; }
|
||||
echo "clippy attempt $n failed — retrying (transient infra)"; sleep 15
|
||||
done
|
||||
|
||||
# Benchmarks must compile (weights are fund-critical: wrong weights enable DoS /
|
||||
# fee miscalculation). We check compilation here; actual weight generation is a
|
||||
# separate release-time step.
|
||||
check-benches:
|
||||
runs-on: [self-hosted, substrate-build]
|
||||
# sccache is intentionally NOT used (its server crashing mid-build failed jobs across
|
||||
# retries); builds compile cold, so allow generous wall-clock instead of the 6h default.
|
||||
timeout-minutes: 720
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Free disk if low
|
||||
# The persistent target dir accumulates artifacts across heavy builds and can
|
||||
# fill smaller runners. Clean it when free space is low; sccache keeps the
|
||||
# rebuild warm. Prevents the "No space left on device" failures.
|
||||
run: |
|
||||
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
|
||||
echo "free: ${avail}G"
|
||||
if [ "${avail:-999}" -lt 80 ]; then echo "cleaning target"; rm -rf target; fi
|
||||
# Backstop on small-disk runners: if still critically low, drop the sccache cache too
|
||||
# so a build can never fill the host disk (these runners share VPSs with validators,
|
||||
# the bridge and web services — a full disk would take those down).
|
||||
avail=$(df -BG --output=avail "$PWD" | tail -1 | tr -dc 0-9)
|
||||
if [ "${avail:-999}" -lt 40 ]; then
|
||||
echo "critically low (${avail}G): clearing sccache"
|
||||
rm -rf "${SCCACHE_DIR:-$HOME/.cache/sccache}"/* 2>/dev/null || true
|
||||
fi
|
||||
# Retry only transient infra failures (crate fetch, sccache first-use, runner glitch on a
|
||||
# capped/shared VPS). A real failure still returns non-zero on every attempt and fails.
|
||||
- name: Check benches
|
||||
run: |
|
||||
n=0
|
||||
until cargo check --workspace --locked --benches --features runtime-benchmarks; do
|
||||
n=$((n+1)); [ "$n" -ge 3 ] && { echo "check-benches failed after $n attempts"; exit 1; }
|
||||
echo "check-benches attempt $n failed — retrying (transient infra)"; sleep 15
|
||||
done
|
||||
@@ -1,165 +0,0 @@
|
||||
# DISABLED: External retester tool configuration issues
|
||||
# Re-enable after mainnet launch when EVM testing infrastructure is ready
|
||||
name: EVM test suite
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Manual trigger only
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
differential-tests:
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
timeout-minutes: 60
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
permissions:
|
||||
pull-requests: write
|
||||
strategy:
|
||||
matrix:
|
||||
platform:
|
||||
["revive-dev-node-revm-solc", "revive-dev-node-polkavm-resolc"]
|
||||
steps:
|
||||
- name: Checkout the Pezkuwi SDK
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Update the Installed Python
|
||||
run: apt-get update && apt-get install -y python3-pip python3
|
||||
- name: Installing the Latest Resolc
|
||||
# NOTE: resolc is an upstream shared tool from paritytech/revive (EVM compiler)
|
||||
run: |
|
||||
VERSION="0.5.0"
|
||||
ASSET_URL="https://github.com/paritytech/revive/releases/download/v$VERSION/resolc-x86_64-unknown-linux-musl"
|
||||
echo "Downloading resolc v$VERSION from $ASSET_URL"
|
||||
curl -Lsf --show-error -o resolc "$ASSET_URL"
|
||||
chmod +x resolc
|
||||
./resolc --version
|
||||
- name: Building the dependencies from the Pezkuwi SDK
|
||||
run: cargo build --locked --profile release -p pezpallet-revive-eth-rpc -p pez-revive-dev-node
|
||||
- name: Checkout the Differential Tests Repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
repository: pezkuwichain/revive-differential-tests
|
||||
ref: main
|
||||
path: revive-differential-tests
|
||||
submodules: recursive
|
||||
- name: Installing Retester
|
||||
run: cargo install --locked --path revive-differential-tests/crates/core
|
||||
- name: Creating a workdir for retester
|
||||
run: mkdir workdir
|
||||
- name: Downloading & Initializing the compilation caches
|
||||
run: |
|
||||
curl -fL --retry 3 --retry-all-errors --connect-timeout 10 -o cache.tar.gz "https://github.com/paritytech/revive-differential-tests/releases/download/compilation-caches-v1.0/cache.tar.gz"
|
||||
tar -zxf cache.tar.gz -C ./workdir > /dev/null 2>&1
|
||||
- name: Running the Differential Tests
|
||||
run: |
|
||||
retester test \
|
||||
--test ./revive-differential-tests/resolc-compiler-tests/fixtures/solidity/simple \
|
||||
--test ./revive-differential-tests/resolc-compiler-tests/fixtures/solidity/complex \
|
||||
--test ./revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests \
|
||||
--platform ${{ matrix.platform }} \
|
||||
--concurrency.number-of-nodes 10 \
|
||||
--concurrency.number-of-threads 10 \
|
||||
--concurrency.number-of-concurrent-tasks 1000 \
|
||||
--working-directory ./workdir \
|
||||
--revive-dev-node.consensus manual-seal-200 \
|
||||
--revive-dev-node.path ./target/release/pez-revive-dev-node \
|
||||
--eth-rpc.path ./target/release/eth-rpc \
|
||||
--resolc.path ./resolc
|
||||
- name: Creating a markdown report of the test execution
|
||||
run: |
|
||||
mv ./workdir/*.json report.json
|
||||
python3 ./.github/scripts/process-differential-tests-report.py report.json ${{ matrix.platform }}
|
||||
# We upload the report as an artifact to the run since there could be
|
||||
# certain cases where the report is too long to post as a Github comment.
|
||||
# This happens if the all of the tests are failing and therefore the
|
||||
# report exceeds the maximum allowed length of github comments
|
||||
- name: Upload the Report to the CI
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
|
||||
with:
|
||||
name: report-${{ matrix.platform }}.md
|
||||
path: report.md
|
||||
- name: Posting the report as a comment on the PR
|
||||
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405
|
||||
if: ${{ contains(github.event.pull_request.labels.*.name, 'T7-smart_contracts') }}
|
||||
with:
|
||||
header: diff-tests-report-${{ matrix.platform }}
|
||||
path: report.md
|
||||
|
||||
evm-test-suite:
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
timeout-minutes: 60
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
# Enable debug assertions since we are running optimized builds for testing
|
||||
# but still want to have debug assertions.
|
||||
RUSTFLAGS: "-C debug-assertions"
|
||||
RUST_BACKTRACE: 1
|
||||
strategy:
|
||||
matrix:
|
||||
platform:
|
||||
["test:pvm", "test:evm"]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: script
|
||||
run: |
|
||||
cargo build --locked --release -p pezpallet-revive-eth-rpc --bin eth-rpc
|
||||
cargo build --locked --release -p pez-revive-dev-node --bin pez-revive-dev-node
|
||||
|
||||
- name: Checkout evm-tests
|
||||
# NOTE: evm-test-suite is an upstream shared test suite from paritytech
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
repository: paritytech/evm-test-suite
|
||||
ref: 9359438a13e8ab68f73320724f8783e170ecc193
|
||||
path: evm-test-suite
|
||||
|
||||
- uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v2.x
|
||||
|
||||
- name: script
|
||||
run: |
|
||||
echo "Change to the evm-test-suite directory"
|
||||
cd evm-test-suite
|
||||
|
||||
deno --version
|
||||
|
||||
echo "Check that binaries are in place"
|
||||
export REVIVE_DEV_NODE_PATH=$(readlink -f ../target/release/pez-revive-dev-node)
|
||||
export ETH_RPC_PATH=$(readlink -f ../target/release/eth-rpc)
|
||||
echo $REVIVE_DEV_NODE_PATH $ETH_RPC_PATH
|
||||
|
||||
echo "== Running tests =="
|
||||
START_REVIVE_DEV_NODE=true START_ETH_RPC=true deno task ${{ matrix.platform }}
|
||||
|
||||
confirm-required-test-evm-jobs-passed:
|
||||
runs-on: ubuntu-latest
|
||||
name: All test misc tests passed
|
||||
# If any new job gets added, be sure to add it to this array
|
||||
needs:
|
||||
- evm-test-suite
|
||||
if: always() && !cancelled()
|
||||
steps:
|
||||
- run: |
|
||||
tee resultfile <<< '${{ toJSON(needs) }}'
|
||||
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
|
||||
if [ $FAILURES -gt 0 ]; then
|
||||
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
@@ -1,123 +0,0 @@
|
||||
# GHA for test-linux-stable-int, test-linux-stable, test-linux-stable-oldkernel
|
||||
name: tests linux stable coverage
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
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
|
||||
|
||||
jobs:
|
||||
preflight:
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
if: contains(github.event.label.name, 'GHA-coverage') || contains(github.event.pull_request.labels.*.name, 'GHA-coverage')
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
test-linux-stable-coverage:
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
timeout-minutes: 120
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
RUST_TOOLCHAIN: stable
|
||||
# Enable debug assertions since we are running optimized builds for testing
|
||||
# but still want to have debug assertions.
|
||||
#
|
||||
# -Cinstrument-coverage slows everything down but it is necessary for code coverage
|
||||
# https://doc.rust-lang.org/rustc/instrument-coverage.html
|
||||
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings -Cinstrument-coverage"
|
||||
LLVM_PROFILE_FILE: "/__w/pezkuwi-sdk/pezkuwi-sdk/target/coverage/cargo-test-${{ matrix.ci_node_index }}-%p-%m.profraw"
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ci_node_index: [1, 2, 3, 4, 5]
|
||||
ci_node_total: [5]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- run: rustup component add llvm-tools-preview
|
||||
- run: cargo install cargo-llvm-cov
|
||||
|
||||
- run: mkdir -p target/coverage
|
||||
|
||||
# Some tests are excluded because they run very slowly or fail with -Cinstrument-coverage
|
||||
- name: run tests
|
||||
run: >
|
||||
time cargo llvm-cov nextest
|
||||
--no-report --release
|
||||
--workspace
|
||||
--locked --no-fail-fast
|
||||
--features try-runtime,ci-only-tests,experimental
|
||||
--filter-expr "
|
||||
!test(/.*benchmark.*/)
|
||||
- test(/recovers_from_only_chunks_if_pov_large::case_1/)
|
||||
- test(/participation_requests_reprioritized_for_newly_included/)
|
||||
- test(/availability_is_recovered_from_chunks_if_no_group_provided::case_1/)
|
||||
- test(/rejects_missing_inherent_digest/)
|
||||
- test(/availability_is_recovered_from_chunks_even_if_backing_group_supplied_if_chunks_only::case_1/)
|
||||
- test(/availability_is_recovered_from_chunks_if_no_group_provided::case_2/)
|
||||
- test(/all_security_features_work/)
|
||||
- test(/nonexistent_cache_dir/)
|
||||
- test(/recovers_from_only_chunks_if_pov_large::case_3/)
|
||||
- test(/recovers_from_only_chunks_if_pov_large::case_2/)
|
||||
- test(/authoring_blocks/)
|
||||
- test(/rejects_missing_seals/)
|
||||
- test(/generate_chain_spec/)
|
||||
- test(/get_preset/)
|
||||
- test(/list_presets/)
|
||||
- test(/tests::receive_rate_limit_is_enforced/)
|
||||
- test(/pezkuwi-availability-recovery/)
|
||||
"
|
||||
--partition count:${{ matrix.ci_node_index }}/${{ matrix.ci_node_total }}
|
||||
|
||||
- name: generate report
|
||||
run: cargo llvm-cov report --release --codecov --output-path coverage-${{ matrix.ci_node_index }}.lcov
|
||||
- name: upload report
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: coverage-report-${{ matrix.ci_node_index }}.lcov
|
||||
path: coverage-${{ matrix.ci_node_index }}.lcov
|
||||
|
||||
#
|
||||
#
|
||||
# Upload to codecov
|
||||
upload-reports:
|
||||
needs: [test-linux-stable-coverage]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
with:
|
||||
path: reports
|
||||
pattern: coverage-report-*
|
||||
merge-multiple: true
|
||||
- run: ls -al reports/
|
||||
- name: Upload to Codecov
|
||||
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
verbose: true
|
||||
directory: reports
|
||||
root_dir: /__w/pezkuwi-sdk/pezkuwi-sdk/
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
remove-label:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [upload-reports]
|
||||
if: github.event_name == 'pull_request'
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0
|
||||
with:
|
||||
labels: GHA-coverage
|
||||
@@ -1,92 +0,0 @@
|
||||
# GHA for test-linux-stable-int, test-linux-stable, test-linux-stable-oldkernel with new runners
|
||||
name: tests linux stable experimental
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
merge_group:
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
if: false
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
# No filter for 'all_security_features_work' and 'nonexistent_cache_dir'
|
||||
# run all tests on cattery runners
|
||||
test-linux-stable-no-try-runtime:
|
||||
needs: [preflight]
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
options: --privileged
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
partition: [1/2, 2/2]
|
||||
env:
|
||||
RUST_TOOLCHAIN: stable
|
||||
# Enable debug assertions since we are running optimized builds for testing
|
||||
# but still want to have debug assertions.
|
||||
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: script
|
||||
id: required
|
||||
run: |
|
||||
cargo nextest run --workspace \
|
||||
--locked \
|
||||
--release \
|
||||
--no-fail-fast \
|
||||
--features experimental,ci-only-tests \
|
||||
--partition count:${{ matrix.partition }}
|
||||
|
||||
test-linux-stable:
|
||||
needs: [preflight]
|
||||
runs-on: ${{ matrix.runners }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
partition: [1/3, 2/3, 3/3]
|
||||
runners: [ubuntu-latest]
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
# needed for tests that use unshare syscall
|
||||
options: --privileged
|
||||
env:
|
||||
RUST_TOOLCHAIN: stable
|
||||
# Enable debug assertions since we are running optimized builds for testing
|
||||
# but still want to have debug assertions.
|
||||
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: script
|
||||
id: required
|
||||
run: |
|
||||
# Fixes "detected dubious ownership" error in the ci
|
||||
git config --global --add safe.directory '*'
|
||||
cargo nextest run \
|
||||
--workspace \
|
||||
--locked \
|
||||
--release \
|
||||
--no-fail-fast \
|
||||
--cargo-quiet \
|
||||
--features try-runtime,experimental,ci-only-tests \
|
||||
--partition count:${{ matrix.partition }}
|
||||
# run runtime-api tests with `enable-pez-staging-api` feature on the 1st node
|
||||
- name: runtime-api tests
|
||||
if: ${{ matrix.partition == '1/3' }}
|
||||
run: cargo nextest run -p pezsp-api-test --features enable-pez-staging-api --cargo-quiet
|
||||
@@ -1,169 +0,0 @@
|
||||
# GHA for test-linux-stable-int, test-linux-stable, test-linux-stable-oldkernel
|
||||
# DISABLED: Infrastructure issues (Docker network pool, serde_core WASM bug)
|
||||
# Re-enable after mainnet launch when CI infrastructure is stabilized
|
||||
name: tests linux stable
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Manual trigger only
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
test-linux-stable-int:
|
||||
needs: [preflight]
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_NEW }}
|
||||
timeout-minutes: 60
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
volumes:
|
||||
- /cache/cargo-target/pezkuwi-sdk:/cache/target
|
||||
env:
|
||||
RUSTFLAGS: "-C debug-assertions -D warnings"
|
||||
RUST_BACKTRACE: 1
|
||||
WASM_BUILD_NO_COLOR: 1
|
||||
WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings"
|
||||
# Ensure we run the UI tests.
|
||||
RUN_UI_TESTS: 1
|
||||
CARGO_TARGET_DIR: /cache/target
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: script
|
||||
id: required
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
WASM_BUILD_NO_COLOR=1 cargo test -p pezstaging-node-cli --release --locked -- --ignored
|
||||
|
||||
# https://github.com/pezkuwichain/ci_cd/issues/864
|
||||
test-linux-stable-runtime-benchmarks:
|
||||
needs: [preflight]
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_NEW }}
|
||||
timeout-minutes: 60
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
volumes:
|
||||
- /cache/cargo-target/pezkuwi-sdk:/cache/target
|
||||
env:
|
||||
RUST_TOOLCHAIN: stable
|
||||
# Enable debug assertions since we are running optimized builds for testing
|
||||
# but still want to have debug assertions.
|
||||
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
|
||||
CARGO_TARGET_DIR: /cache/target
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: script
|
||||
id: required
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet --cargo-quiet
|
||||
|
||||
test-linux-stable:
|
||||
needs: [preflight]
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_NEW }}
|
||||
timeout-minutes: 75
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Reduced from 3x2=6 jobs to 3 jobs (single runner type)
|
||||
partition: [1/3, 2/3, 3/3]
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
options: --privileged
|
||||
volumes:
|
||||
- /cache/cargo-target/pezkuwi-sdk:/cache/target
|
||||
env:
|
||||
RUST_TOOLCHAIN: stable
|
||||
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_TARGET_DIR: /cache/target
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: script
|
||||
id: required
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
cargo nextest run \
|
||||
--workspace \
|
||||
--locked \
|
||||
--release \
|
||||
--no-fail-fast \
|
||||
--cargo-quiet \
|
||||
--features try-runtime,experimental,ci-only-tests \
|
||||
--partition count:${{ matrix.partition }}
|
||||
|
||||
- name: runtime-api tests
|
||||
if: ${{ matrix.partition == '1/3' }}
|
||||
run: cargo nextest run -p pezsp-api-test --features enable-pez-staging-api --cargo-quiet
|
||||
|
||||
# some tests do not run with `try-runtime` feature enabled
|
||||
# https://github.com/pezkuwichain/pezkuwi-sdk/pull/4251#discussion_r1624282143
|
||||
test-linux-stable-no-try-runtime:
|
||||
needs: [preflight]
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_NEW }}
|
||||
timeout-minutes: 60
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
options: --privileged
|
||||
volumes:
|
||||
- /cache/cargo-target/pezkuwi-sdk:/cache/target
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
partition: [1/2, 2/2]
|
||||
env:
|
||||
RUST_TOOLCHAIN: stable
|
||||
# Enable debug assertions since we are running optimized builds for testing
|
||||
# but still want to have debug assertions.
|
||||
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
|
||||
CARGO_TARGET_DIR: /cache/target
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: script
|
||||
id: required
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
cargo nextest run --workspace \
|
||||
--locked \
|
||||
--release \
|
||||
--no-fail-fast \
|
||||
--cargo-quiet \
|
||||
--features experimental,ci-only-tests \
|
||||
--partition count:${{ matrix.partition }}
|
||||
|
||||
confirm-required-jobs-passed:
|
||||
runs-on: ubuntu-latest
|
||||
name: All tests passed
|
||||
# If any new job gets added, be sure to add it to this array
|
||||
needs:
|
||||
[
|
||||
test-linux-stable-int,
|
||||
test-linux-stable-runtime-benchmarks,
|
||||
test-linux-stable,
|
||||
test-linux-stable-no-try-runtime,
|
||||
]
|
||||
if: always() && !cancelled()
|
||||
steps:
|
||||
- run: |
|
||||
tee resultfile <<< '${{ toJSON(needs) }}'
|
||||
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
|
||||
if [ $FAILURES -gt 0 ]; then
|
||||
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
@@ -1,526 +0,0 @@
|
||||
name: tests misc
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
merge_group:
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# Jobs in this workflow depend on each other, only for limiting peak amount of spawned workers
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
# more information about this job can be found here:
|
||||
# https://github.com/pezkuwichain/bizinikiwi/pull/3778
|
||||
test-full-crypto-feature:
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
timeout-minutes: 60
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
# Enable debug assertions since we are running optimized builds for testing
|
||||
# but still want to have debug assertions.
|
||||
RUSTFLAGS: "-C debug-assertions"
|
||||
RUST_BACKTRACE: 1
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: script
|
||||
run: |
|
||||
cd bizinikiwi/primitives/core/
|
||||
cargo build --locked --no-default-features --features full_crypto
|
||||
cd ../application-crypto
|
||||
cargo build --locked --no-default-features --features full_crypto
|
||||
|
||||
test-pezframe-examples-compile-to-wasm:
|
||||
timeout-minutes: 45
|
||||
# into one job
|
||||
needs: [preflight, test-full-crypto-feature]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
# Enable debug assertions since we are running optimized builds for testing
|
||||
# but still want to have debug assertions.
|
||||
RUSTFLAGS: "-C debug-assertions"
|
||||
RUST_BACKTRACE: 1
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
|
||||
- name: script
|
||||
run: |
|
||||
cd bizinikiwi/pezframe/examples/offchain-worker/
|
||||
RUSTFLAGS="--cfg bizinikiwi_runtime" cargo build --locked --target=wasm32v1-none --no-default-features
|
||||
cd ../basic
|
||||
RUSTFLAGS="--cfg bizinikiwi_runtime" cargo build --locked --target=wasm32v1-none --no-default-features
|
||||
|
||||
test-pezframe-ui:
|
||||
timeout-minutes: 150
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
RUSTFLAGS: "-C debug-assertions -D warnings"
|
||||
RUST_BACKTRACE: 1
|
||||
RUN_UI_TESTS: 1
|
||||
CARGO_INCREMENTAL: 0
|
||||
WASM_BUILD_WORKSPACE_HINT: ${{ github.workspace }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
|
||||
with:
|
||||
shared-key: pezframe-ui
|
||||
cache-on-failure: true
|
||||
|
||||
- name: script
|
||||
run: |
|
||||
cargo version
|
||||
cargo test --locked -q --profile testnet -p pezframe-support-test --features=frame-feature-testing,no-metadata-docs,try-runtime,experimental ui
|
||||
cargo test --locked -q --profile testnet -p pezframe-support-test --features=frame-feature-testing,frame-feature-testing-2,no-metadata-docs,try-runtime,experimental ui
|
||||
cargo test --locked -q --profile testnet -p xcm-pez-procedural ui
|
||||
cargo test --locked -q --profile testnet -p pezframe-election-provider-solution-type ui
|
||||
cargo test --locked -q --profile testnet -p pezsp-api-test ui
|
||||
cargo test --locked -q --profile testnet --manifest-path bizinikiwi/primitives/runtime-interface/Cargo.toml ui
|
||||
|
||||
test-deterministic-wasm:
|
||||
timeout-minutes: 180
|
||||
needs: [preflight, test-full-crypto-feature]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
WASM_BUILD_NO_COLOR: 1
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
|
||||
- name: Clean cargo cache to free disk space
|
||||
run: |
|
||||
cargo clean 2>/dev/null || true
|
||||
rm -rf ~/.cargo/registry/cache 2>/dev/null || true
|
||||
rm -rf ~/.cargo/git/db 2>/dev/null || true
|
||||
|
||||
- name: script
|
||||
run: |
|
||||
# build runtime
|
||||
cargo build -q --locked --release -p zagros-runtime -p pezkuwichain-runtime
|
||||
# make checksum — find wasm blobs regardless of target triple
|
||||
find target/release/wbuild/ -name '*.wasm' -path '*/release/*' | sort | xargs sha256sum > checksum.sha256
|
||||
cargo clean
|
||||
# build again
|
||||
cargo build -q --locked --release -p zagros-runtime -p pezkuwichain-runtime
|
||||
# confirm checksum
|
||||
sha256sum -c checksum.sha256
|
||||
|
||||
cargo-check-benches:
|
||||
needs: [preflight]
|
||||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
matrix:
|
||||
branch: [main, current]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
|
||||
# if branch is main, use the branch, otherwise set empty string, so it uses the current context
|
||||
# either PR (including forks) or merge group (main repo)
|
||||
ref: ${{ matrix.branch == 'main' && matrix.branch || '' }}
|
||||
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: script
|
||||
shell: bash
|
||||
run: |
|
||||
# Fail the step if any command in a pipeline errors out.
|
||||
set -euo pipefail
|
||||
ARTIFACTS_DIR=./artifacts
|
||||
BENCH_TRIE_READ=::trie::read::small
|
||||
BENCH_NODE_IMPORT=::node::import::sr25519::transfer_keep_alive::paritydb::small
|
||||
mkdir -p $ARTIFACTS_DIR
|
||||
|
||||
# Exclude packages with feature unification issues with --benches flag
|
||||
# (pezframe-support/runtime-benchmarks gets enabled but the package's runtime-benchmarks doesn't)
|
||||
# pezpallet-tiki and all its dependents need to be excluded due to EnsureOrigin trait issues
|
||||
SKIP_WASM_BUILD=1 cargo check --locked --benches --workspace \
|
||||
--exclude pezpallet-tiki \
|
||||
--exclude pezpallet-trust \
|
||||
--exclude pezpallet-welati \
|
||||
--exclude pezpallet-pez-rewards \
|
||||
--exclude people-pezkuwichain-runtime \
|
||||
--exclude pezkuwi-teyrchain-bin \
|
||||
--exclude asset-hub-zagros-runtime \
|
||||
--exclude asset-hub-pezkuwichain-runtime \
|
||||
--exclude collectives-zagros-runtime;
|
||||
cargo run --locked --release -p pez-node-bench -- $BENCH_TRIE_READ --json | tee $ARTIFACTS_DIR/bench_trie_read_small.json;
|
||||
cargo run --locked --release -p pez-node-bench -- $BENCH_NODE_IMPORT --json | tee $ARTIFACTS_DIR/bench_transfer_keep_alive.json
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
path: ./artifacts
|
||||
name: cargo-check-benches-${{ matrix.branch }}-${{ github.sha }}
|
||||
retention-days: 1
|
||||
|
||||
pez-node-bench-regression-guard:
|
||||
timeout-minutes: 20
|
||||
# Only run on PR/merge_group where cargo-check-benches produces artifacts
|
||||
if: always() && !cancelled() && (github.event_name == 'pull_request' || github.event_name == 'merge_group')
|
||||
runs-on: ubuntu-latest
|
||||
needs: [preflight, cargo-check-benches]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Download artifact (main run)
|
||||
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: cargo-check-benches-main-${{ github.sha }}
|
||||
path: ./artifacts/main
|
||||
|
||||
- name: Download artifact (current run)
|
||||
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: cargo-check-benches-current-${{ github.sha }}
|
||||
path: ./artifacts/current
|
||||
|
||||
- name: script
|
||||
id: compare
|
||||
run: |
|
||||
if [ "${{ github.ref_name }}" = "main" ]; then
|
||||
echo -e "Exiting on main branch"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# fail if no artifacts
|
||||
if [ ! -d ./artifacts/main ] || [ ! -d ./artifacts/current ]; then
|
||||
echo "No artifacts found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# NOTE: Using echo instead of docker - pezkuwichain/pez-node-bench-regression-guard not available for Pezkuwi
|
||||
# If benchmark regression guard is needed, fork the tool to pezkuwichain
|
||||
echo "::notice::Benchmark regression guard check skipped - tool not available for Pezkuwi SDK"
|
||||
echo "Comparing artifacts from main and current..."
|
||||
if [ -d "$PWD/artifacts/main" ] && [ -d "$PWD/artifacts/current" ]; then
|
||||
echo "Both artifact directories exist"
|
||||
ls -la $PWD/artifacts/main/ || true
|
||||
ls -la $PWD/artifacts/current/ || true
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
FAILED_MSG='### pez-node-bench-regression-guard failed ❌, check the regression in *cargo-check-benches* job'
|
||||
echo $FAILED_MSG
|
||||
echo $FAILED_MSG >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo "### pez-node-bench-regression-guard passed ✅" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
test-node-metrics:
|
||||
needs: [preflight]
|
||||
timeout-minutes: 180
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
|
||||
- name: Clean cargo cache to free disk space
|
||||
run: |
|
||||
cargo clean 2>/dev/null || true
|
||||
rm -rf ~/.cargo/registry/cache 2>/dev/null || true
|
||||
rm -rf ~/.cargo/git/db 2>/dev/null || true
|
||||
|
||||
- name: Run tests
|
||||
id: tests
|
||||
env:
|
||||
RUST_TOOLCHAIN: stable
|
||||
# Enable debug assertions since we are running optimized builds for testing
|
||||
# but still want to have debug assertions.
|
||||
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
|
||||
run: |
|
||||
cargo build --bin pezkuwi-execute-worker --bin pezkuwi-prepare-worker --profile testnet --verbose --locked
|
||||
mkdir -p ./artifacts
|
||||
cargo test --profile testnet --locked --features=runtime-metrics -p pezkuwi-node-metrics > ./artifacts/log.txt
|
||||
echo "Metrics test passed"
|
||||
|
||||
- name: Upload artifacts if failed
|
||||
if: ${{ steps.tests.outcome != 'success' }}
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: node-metrics-failed
|
||||
path: ./artifacts
|
||||
|
||||
# more information about this job can be found here:
|
||||
# https://github.com/pezkuwichain/bizinikiwi/pull/6916
|
||||
check-tracing:
|
||||
timeout-minutes: 45
|
||||
needs: [preflight, test-node-metrics]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: script
|
||||
run: |
|
||||
cargo test --locked --manifest-path ./bizinikiwi/primitives/tracing/Cargo.toml --no-default-features
|
||||
cargo test --locked --manifest-path ./bizinikiwi/primitives/tracing/Cargo.toml --no-default-features --features=with-tracing
|
||||
|
||||
check-metadata-hash:
|
||||
timeout-minutes: 45
|
||||
needs: [preflight, check-tracing]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
|
||||
- name: script
|
||||
run: |
|
||||
cargo build --locked -p zagros-runtime --features metadata-hash
|
||||
|
||||
# disabled until https://github.com/pezkuwichain/pezkuwi-sdk/issues/5812 is resolved
|
||||
# cargo-hfuzz:
|
||||
# timeout-minutes: 20
|
||||
# needs: [preflight, check-metadata-hash]
|
||||
# runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
# container:
|
||||
# image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
# env:
|
||||
# # max 10s per iteration, 60s per file
|
||||
# HFUZZ_RUN_ARGS: |
|
||||
# --exit_upon_crash
|
||||
# --exit_code_upon_crash 1
|
||||
# --timeout 10
|
||||
# --run_time 60
|
||||
|
||||
# # use git version of honggfuzz-rs until v0.5.56 is out, we need a few recent changes:
|
||||
# # https://github.com/rust-fuzz/honggfuzz-rs/pull/75 to avoid breakage on debian
|
||||
# # https://github.com/rust-fuzz/honggfuzz-rs/pull/81 fix to the above pr
|
||||
# # https://github.com/rust-fuzz/honggfuzz-rs/pull/82 fix for handling absolute CARGO_TARGET_DIR
|
||||
# HFUZZ_BUILD_ARGS: |
|
||||
# --config=patch.crates-io.honggfuzz.git="https://github.com/altaua/honggfuzz-rs"
|
||||
# --config=patch.crates-io.honggfuzz.rev="205f7c8c059a0d98fe1cb912cdac84f324cb6981"
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v4
|
||||
|
||||
# - name: Run honggfuzz
|
||||
# run: |
|
||||
# cd bizinikiwi/primitives/arithmetic/fuzzer
|
||||
# cargo hfuzz build
|
||||
# for target in $(cargo read-manifest | jq -r '.targets | .[] | .name');
|
||||
# do
|
||||
# cargo hfuzz run "$target" || { printf "fuzzing failure for %s\n" "$target"; exit 1; };
|
||||
# done
|
||||
|
||||
# - name: Upload artifacts
|
||||
# uses: actions/upload-artifact@v4.3.6
|
||||
# with:
|
||||
# path: bizinikiwi/primitives/arithmetic/fuzzer/hfuzz_workspace/
|
||||
# name: hfuzz-${{ github.sha }}
|
||||
|
||||
cargo-check-each-crate:
|
||||
timeout-minutes: 300
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
RUSTFLAGS: "-D warnings"
|
||||
CI_JOB_NAME: cargo-check-each-crate
|
||||
CARGO_INCREMENTAL: 0
|
||||
SKIP_WASM_BUILD: 1
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
index: [1, 2, 3, 4] # Reduced from 7 to 4 parallel jobs to lower system load
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
|
||||
with:
|
||||
shared-key: check-each-crate-${{ matrix.index }}
|
||||
cache-on-failure: true
|
||||
|
||||
- name: script
|
||||
run: |
|
||||
PYTHONUNBUFFERED=x .github/scripts/check-each-crate.py ${{ matrix.index }} ${{ strategy.job-total }}
|
||||
|
||||
cargo-check-all-crate-macos:
|
||||
timeout-minutes: 150
|
||||
needs: [preflight]
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER_MACOS }}
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
# Informational: macOS runner disk space issues cause sporadic failures.
|
||||
# Remove continue-on-error once runner infrastructure is stable.
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Free disk space
|
||||
run: |
|
||||
echo "Disk space before cleanup:"
|
||||
df -h /
|
||||
# Remove large pre-installed tools to free disk space
|
||||
sudo rm -rf /Library/Developer/CommandLineTools/SDKs 2>/dev/null || true
|
||||
sudo rm -rf /Users/runner/Library/Android 2>/dev/null || true
|
||||
sudo rm -rf /usr/local/share/powershell 2>/dev/null || true
|
||||
sudo rm -rf /usr/local/lib/node_modules 2>/dev/null || true
|
||||
brew cleanup --prune=all 2>/dev/null || true
|
||||
echo "Disk space after cleanup:"
|
||||
df -h /
|
||||
- name: Set rust version from env file
|
||||
run: |
|
||||
RUST_VERSION=$(cat .github/env | sed -E 's/.*ci-unified:([^-]+)-([^-]+).*/\2/')
|
||||
echo $RUST_VERSION
|
||||
echo "RUST_VERSION=${RUST_VERSION}" >> $GITHUB_ENV
|
||||
- name: Set up Homebrew
|
||||
uses: Homebrew/actions/setup-homebrew@1ccc07ccd54b6048295516a3eb89b192c35057dc # master from 12.09.2024
|
||||
# Is broken because of different bash versions
|
||||
# - name: Install rust ${{ env.RUST_VERSION }}
|
||||
# uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
|
||||
# with:
|
||||
# cache: false
|
||||
# toolchain: ${{ env.RUST_VERSION }}
|
||||
# target: wasm32-unknown-unknown
|
||||
# components: cargo, clippy, rust-docs, rust-src, rustfmt, rustc, rust-std
|
||||
- name: Install rust ${{ env.RUST_VERSION }}
|
||||
run: |
|
||||
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUST_VERSION
|
||||
source $HOME/.cargo/env
|
||||
rustup target add wasm32v1-none
|
||||
rustup component add clippy rust-docs rust-src rustfmt rustc rust-std
|
||||
- name: Install protobuf
|
||||
run: brew install protobuf
|
||||
- name: install solc
|
||||
run: |
|
||||
# Install solc-select to manage solc versions
|
||||
# Use --break-system-packages for macOS externally-managed Python
|
||||
pip3 install --break-system-packages solc-select
|
||||
# Install and use solc 0.8.30 (revive only supports up to 0.8.30)
|
||||
solc-select install 0.8.30
|
||||
solc-select use 0.8.30
|
||||
solc --version
|
||||
- name: Install resolc
|
||||
# NOTE: resolc is an upstream shared tool from paritytech/revive (EVM compiler)
|
||||
run: |
|
||||
source $HOME/.cargo/env
|
||||
VERSION="0.5.0"
|
||||
ASSET_URL="https://github.com/paritytech/revive/releases/download/v$VERSION/resolc-universal-apple-darwin"
|
||||
echo "Downloading resolc v$VERSION from $ASSET_URL"
|
||||
curl -Lsf --show-error -o $HOME/.cargo/bin/resolc "$ASSET_URL"
|
||||
chmod +x $HOME/.cargo/bin/resolc
|
||||
xattr -c $HOME/.cargo/bin/resolc
|
||||
resolc --version
|
||||
- name: Install llvm
|
||||
run: |
|
||||
brew install llvm@20
|
||||
brew link llvm@20
|
||||
- name: cargo info
|
||||
run: |
|
||||
source $HOME/.cargo/env
|
||||
echo "######## rustup show ########"
|
||||
rustup show
|
||||
echo "######## cargo --version ########"
|
||||
cargo --version
|
||||
- name: Run cargo check
|
||||
run: |
|
||||
source $HOME/.cargo/env
|
||||
cargo check --workspace --locked
|
||||
|
||||
confirm-required-test-misc-jobs-passed:
|
||||
runs-on: ubuntu-latest
|
||||
name: All test misc tests passed
|
||||
# If any new job gets added, be sure to add it to this array
|
||||
needs:
|
||||
- test-full-crypto-feature
|
||||
- test-pezframe-examples-compile-to-wasm
|
||||
- test-pezframe-ui
|
||||
- test-deterministic-wasm
|
||||
- cargo-check-benches
|
||||
- pez-node-bench-regression-guard
|
||||
- test-node-metrics
|
||||
- check-tracing
|
||||
- cargo-check-each-crate
|
||||
# - cargo-hfuzz remove from required for now, as it's flaky
|
||||
if: always() && !cancelled()
|
||||
steps:
|
||||
- run: |
|
||||
tee resultfile <<< '${{ toJSON(needs) }}'
|
||||
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
|
||||
if [ $FAILURES -gt 0 ]; then
|
||||
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
@@ -1,107 +0,0 @@
|
||||
name: tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
merge_group:
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
isdraft:
|
||||
uses: ./.github/workflows/reusable-isdraft.yml
|
||||
preflight:
|
||||
needs: isdraft
|
||||
uses: ./.github/workflows/reusable-preflight.yml
|
||||
|
||||
# This job runs all benchmarks defined in the `/bin/node/runtime` once to check that there are no errors.
|
||||
quick-benchmarks:
|
||||
needs: [preflight]
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
timeout-minutes: 180
|
||||
# pezpallet_revive excluded: requires PolkaVM toolchain for fixture compilation.
|
||||
# Track via: https://github.com/pezkuwichain/pezkuwi-sdk/issues/TBD
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
RUSTFLAGS: "-C debug-assertions -D warnings"
|
||||
RUST_BACKTRACE: "full"
|
||||
WASM_BUILD_NO_COLOR: 1
|
||||
WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings"
|
||||
CARGO_INCREMENTAL: 0
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
|
||||
with:
|
||||
shared-key: quick-benchmarks
|
||||
cache-on-failure: true
|
||||
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
|
||||
- name: script
|
||||
run: cargo run --locked --release -p pezstaging-node-cli --bin bizinikiwi-node --features runtime-benchmarks --quiet -- benchmark pezpallet --chain dev --pezpallet "*" --extrinsic "*" --exclude-pezpallets pezpallet_revive --steps 2 --repeat 1 --quiet
|
||||
|
||||
# cf https://github.com/pezkuwichain/pezkuwi-sdk/issues/1652
|
||||
test-syscalls:
|
||||
needs: [preflight]
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
timeout-minutes: 120
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
continue-on-error: true # this rarely triggers in practice
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
- name: Install wasm32v1-none target
|
||||
run: rustup target add wasm32v1-none
|
||||
- name: script
|
||||
id: test
|
||||
run: |
|
||||
cargo build --locked --profile production --target x86_64-unknown-linux-musl --bin pezkuwi-execute-worker --bin pezkuwi-prepare-worker --quiet
|
||||
cd pezkuwi/scripts/list-syscalls
|
||||
./list-syscalls.rb ../../../target/x86_64-unknown-linux-musl/production/pezkuwi-execute-worker --only-used-syscalls | diff -u execute-worker-syscalls -
|
||||
./list-syscalls.rb ../../../target/x86_64-unknown-linux-musl/production/pezkuwi-prepare-worker --only-used-syscalls | diff -u prepare-worker-syscalls -
|
||||
- name: on_failure
|
||||
if: failure() && steps.test.outcome == 'failure'
|
||||
run: |
|
||||
echo "The x86_64 syscalls used by the worker binaries have changed. Please review if this is expected and update pezkuwi/scripts/list-syscalls/*-worker-syscalls as needed." >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
cargo-check-all-benches:
|
||||
needs: [preflight]
|
||||
if: ${{ needs.preflight.outputs.changes_rust }}
|
||||
runs-on: ${{ needs.preflight.outputs.RUNNER }}
|
||||
timeout-minutes: 75
|
||||
container:
|
||||
image: ${{ needs.preflight.outputs.IMAGE }}
|
||||
env:
|
||||
SKIP_WASM_BUILD: 1
|
||||
CARGO_INCREMENTAL: 0
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Disable forklift cache wrapper
|
||||
run: echo "RUSTC_WRAPPER=" >> $GITHUB_ENV
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
|
||||
with:
|
||||
shared-key: check-all-benches
|
||||
cache-on-failure: true
|
||||
|
||||
- name: script
|
||||
run: |
|
||||
cargo check --workspace --locked --benches --features runtime-benchmarks --quiet
|
||||
Reference in new issue
Block a user