Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added sync command #4818

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/commands-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The current available command actions are:

- [Command FMT](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-fmt.yml)
- [Command Update UI](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-update-ui.yml)
- [Command Sync](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-sync.yml)
- [Command Bench](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-bench.yml)
- [Command Bench All](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-bench-all.yml)
- [Command Bench Overhead](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-bench-overhead.yml)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/command-bench-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
run: cat .github/env >> $GITHUB_OUTPUT
cmd-bench-all:
needs: [set-image]
runs-on: arc-runners-polkadot-sdk-benchmark
runs-on: arc-runners-polkadot-sdk-weights
container:
image: ${{ needs.set-image.outputs.IMAGE }}
steps:
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/command-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Command Sync

on:
workflow_dispatch:
inputs:
pr:
description: Number of the Pull Request
required: true
chain:
description: Chain
type: choice
required: true
options:
- westend
- rococo
sync-type:
description: Sync type
type: choice
required: true
options:
- warp
- full
- fast
- fast-unsafe

jobs:
set-image:
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
cmd-sync:
needs: [set-image]
runs-on: arc-runners-polkadot-sdk-warpsync
container:
image: ${{ needs.set-image.outputs.IMAGE }}
steps:
- name: Download repo
uses: actions/checkout@v4
- name: Install gh cli
id: gh
uses: ./.github/actions/set-up-gh
with:
pr-number: ${{ inputs.pr }}
GH_TOKEN: ${{ github.token }}
- name: Run sync
run: |
"./scripts/sync.sh" --chain "${{ inputs.chain }}" --type "${{ inputs.sync-type }}"
- name: Report failure
if: ${{ failure() }}
run: gh pr comment ${{ inputs.pr }} --body "<h2>Command failed ❌</h2> Run by @${{ github.actor }} for <code>${{ github.workflow }}</code> failed. See logs <a href=\"$RUN\">here</a>."
env:
RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
GH_TOKEN: ${{ github.token }}
- run: git pull --rebase
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: cmd-action - ${{ github.workflow }}
branch: ${{ steps.gh.outputs.branch }}
- name: Report succeed
run: gh pr comment ${{ inputs.pr }} --body "<h2>Action completed 🎉🎉</h2> Run by @${{ github.actor }} for <code>${{ github.workflow }}</code> completed 🎉. See logs <a href=\"$RUN\">here</a>."
env:
RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
GH_TOKEN: ${{ github.token }}
Loading