-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b7a4c9
commit 893dd19
Showing
3 changed files
with
61 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Try Runtime GHA | ||
|
||
Try Runtime GHA makes it easy to add [try-runtime](https://paritytech.github.io/try-runtime-cli/try_runtime/) checks to your CI. | ||
|
||
## Motivation | ||
|
||
`try-runtime` enforces critical invariants such as: | ||
|
||
- Migrations execute correctly, including `pre_upgrade` and `post_upgrade` hooks | ||
- Migration execution does not exceed the block weight limit | ||
- Migrations are idempotent | ||
- Try State invariants pass | ||
- Post-Migration, all runtime state is decodable | ||
|
||
Given that code changes can break any of the above invariants, running `try-runtime` checks is as important as regularly running cargo tests in your PR CI, to prevent accidental regressions. | ||
|
||
## Usage | ||
|
||
Create a new [Github Action Workflow](https://docs.github.com/en/actions/using-workflows). | ||
|
||
The simplest usage only requires two parameters `runtime-package`, and `node-uri`: | ||
|
||
```yaml | ||
name: Check Migrations | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
jobs: | ||
check-migrations: | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run Polkadot Try Runtime Checks | ||
uses: "paritytech/try-runtime-gha@main" | ||
with: | ||
runtime-package: "my-runtime" | ||
node-uri: "wss://my-runtime-uri:443" | ||
``` | ||
When triggered, the GHA will | ||
1. Build the `runtime-package` with flags `--production` and `--features try-runtime` | ||
2. Download [try-runtime-cli](https://github.com/paritytech/try-runtime-cli) | ||
3. Exec `try-runtime on-runtime-upgrade --checks [checks] [extra-args] live [node-uri] | ||
|
||
If there is an error, you can check the logs for the exact command that failed to help reproduce the issue in your local environment. | ||
|
||
See more examples at [`.github/workflows/examples.yml`](https://github.com/paritytech/try-runtime-gha/blob/main/.github/workflows/examples.yml). |