Skip to content

Commit

Permalink
420 change github workflow to run test with feature flags (#488)
Browse files Browse the repository at this point in the history
* restructure imports for update, relevant modifications of chain extensions

* WIP fixing std issue

* modification toml pendulum, orml-currencies, amplitude

* adding pallets to sibling chain

* compile sibling tests with emulator macros, fixing tests

* remove .txt files

* Revert "format nightly for latest changes"

This reverts commit e03041e.

* generate weights for dia-oracle pallet

* re-introduce non local definition flag for clippy

* remove temporary dia-oracle fix branch

* run fmt nightly

* add benchmarkings (those not failed), modify config to use default weight

* Revert "add benchmarkings (those not failed), modify config to use default weight"

This reverts commit 79012a1.

* fix benchmark for orml-tokens-management, add benchmark helper script, run benchmarks

* initial push. Does not
```
error[E0046]: not all trait items implemented, missing: `try_successful_origin`
  --> /Users/b.carlayap/.cargo/git/checkouts/cumulus-59522f43471fa161/f603a61/parachains/runtimes/assets/common/src/foreign_creators.rs:28:1
   |
28 | / impl<
29 | |         IsForeign: ContainsPair<MultiLocation, MultiLocation>,
30 | |         AccountOf: Convert<MultiLocation, AccountId>,
31 | |         AccountId: Clone,
...  |
36 | |     RuntimeOrigin::PalletsOrigin:
37 | |         From<XcmOrigin> + TryInto<XcmOrigin, Error = RuntimeOrigin::PalletsOrigin>,
   | |___________________________________________________________________________________^ missing `try_successful_origin` in implementation
   ```
   just yet

* fix https://github.com/pendulum-chain/pendulum/actions/runs/10076985515/job/27858509228?pr=488#step:8:1708 and diagnostic issue

* rebase with polkadot-v1.1.0; removed mocktopus

* fix unimplemented runtime-benchmarks

* fix invalid array

* fix unimplemented traits and run in workflow

* #488 (comment)

* run workflow on edited

* do not specify type or branch

* completely remove nightly

* https://github.com/pendulum-chain/pendulum/actions/runs/10827044810/job/30039330371#step:5:1949

* set the features, remove `--all`

* integration-test does not need the `runtime-benchmarks` and `try-runtime`

move the benchmark to another workflow

* rename the workflow name

* revert to ubuntu-20

* clear disk space

* add back the accidentally deleted checkout

* revert to latest because of rust-lang/rustup#3581

* reapply the other cleans

* fix CI

* remove bandersnatch

update CI to 1 file only

* revert from 71396e6

* rebase and fix yml files.

* fix issues unrelated to this ticket

---------

Co-authored-by: Gianfranco <g.tasteri@gmail.com>
  • Loading branch information
b-yap and gianfra-t authored Oct 30, 2024
1 parent f9ca9df commit 72b91f7
Show file tree
Hide file tree
Showing 20 changed files with 129 additions and 125 deletions.
18 changes: 15 additions & 3 deletions .github/actions/shared/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,24 @@ runs:
df -h
shell: bash

- name: Install package
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false

# Steps taken from https://github.com/actions/runner-images/issues/7192#issuecomment-1446766800
- name: Disable Phase Updates
shell: bash
run: |
echo 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updates
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev
- name: Update, Upgrade, and Install Protobuf
shell: bash
run: |
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev
# Steps taken from https://github.com/actions/cache/blob/master/examples.md#rust---cargo
- name: Cache cargo registry
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/clippy-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Clippy Checks

on:
pull_request:
push:
branches:
- main

jobs:
clippy-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Free up Space and Installation
uses: ./.github/actions/shared

- name: Clippy -- Main
uses: actions-rs/cargo@v1
with:
command: clippy
args: --release --all-features -- -W clippy::all -A clippy::style -A forgetting_copy_types -A forgetting_references

- name: Clippy -- All Targets (except integration)
uses: actions-rs/cargo@v1
with:
command: clippy
# We are a bit more forgiving when it comes to the code in tests and only check for correctness
args: --release --workspace --all-features --all-targets --exclude runtime-integration-tests -- -A clippy::all -W clippy::correctness -A forgetting_copy_types -A forgetting_references

- name: Clippy -- Integration
uses: actions-rs/cargo@v1
with:
command: clippy
# We are a bit more forgiving when it comes to the code in tests and only check for correctness
args: --release --package runtime-integration-tests --all-features --all-targets -- -A clippy::all -W clippy::correctness -A forgetting_copy_types -A forgetting_references

47 changes: 7 additions & 40 deletions .github/workflows/test-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Test Code

on:
pull_request:
branches:
- main
push:
branches:
- main
Expand All @@ -16,23 +14,11 @@ jobs:
RUSTFLAGS: "-Dwarnings"

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/shared

- name: Remove rust-toolchain.toml
# To make sure that the nightly version will be used all throughout
run: |
rm /home/runner/work/pendulum/pendulum/rust-toolchain.toml
- name: Checkout
uses: actions/checkout@v4

- name: Setup nightly Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2024-05-30
components: rustfmt, clippy
target: wasm32-unknown-unknown

- name: Setup nightly Rust as default
run: rustup default nightly-2024-05-30
- name: Free up Space and Installation
uses: ./.github/actions/shared

- name: Install Protoc
uses: arduino/setup-protoc@v1
Expand All @@ -42,30 +28,11 @@ jobs:
- name: Test
uses: actions-rs/cargo@v1
with:
toolchain: nightly-2024-05-30
command: test
args: --release

- name: Clippy -- Main
uses: actions-rs/cargo@v1
with:
toolchain: nightly-2024-05-30
command: clippy
args: --release --all-features -- -W clippy::all -A clippy::style -A forgetting_copy_types -A forgetting_references

- name: Clippy -- All Targets (except integration)
uses: actions-rs/cargo@v1
with:
toolchain: nightly-2024-05-30
command: clippy
# We are a bit more forgiving when it comes to the code in tests and only check for correctness
args: --workspace --release --all-features --all-targets --exclude runtime-integration-tests -- -A clippy::all -W clippy::correctness -A forgetting_copy_types -A forgetting_references

- name: Clippy -- Integration
- name: Test for Runtime Benchmarks
uses: actions-rs/cargo@v1
with:
toolchain: nightly-2024-05-30
command: clippy
# We are a bit more forgiving when it comes to the code in tests and only check for correctness
args: --package runtime-integration-tests --release --all-features --all-targets -- -A clippy::all -W clippy::correctness -A forgetting_copy_types -A forgetting_references

command: test
args: --release --features=runtime-benchmarks,try-runtime
75 changes: 34 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 72b91f7

Please sign in to comment.