Skip to content

update ci #22

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

Merged
merged 12 commits into from
May 22, 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
52 changes: 41 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check
name: Build

on:
push:
Expand All @@ -14,35 +14,65 @@ concurrency:
cancel-in-progress: true

jobs:
build:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: rust-src, rustfmt, clippy

- uses: Swatinem/rust-cache@v2

- name: Check format
run: cargo fmt --all -- --check

- name: Make dummpy poc-guest.polkavm file
run: mkdir -p output; touch output/poc-guest.polkavm

- name: Cargo clippy
run: SKIP_WASM_BUILD= cargo clippy -- -D warnings

- name: Check no-std
run: make check-wasm

- name: Check std
run: SKIP_WASM_BUILD= cargo check

build-guest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2
with:
workspaces: poc/guest -> poc/guest/target
cache-all-crates: true

- name: Install toolchain targeting RV32E
run: |
curl -sL https://github.com/paritytech/rustc-rv32e-toolchain/releases/download/v1.1.0/rust-rve-nightly-2024-01-05-x86_64-unknown-linux-gnu.tar.zst -o rv32e.tar.zst
tar --zstd -xf rv32e.tar.zst
mv rve-nightly ~/.rustup/toolchains/

- uses: Swatinem/rust-cache@v2

- name: Check format
run: cargo fmt --all -- --check
- name: Cargo clippy
run: cd poc/guest; cargo clippy -- -D warnings

- name: Install polkatool
run: make tools
run: make polkatool

- name: Generate poc-guest.polkavm
run: make poc-guest

- name: Custom cargo clippy
run: make clippy
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,22 @@ poc-guest:
mkdir -p output
polkatool link --run-only-if-newer -s poc/guest/target/riscv32ema-unknown-none-elf/release/poc-guest -o output/poc-guest.polkavm

tools:
cargo install --git https://github.com/koute/polkavm --force polkatool
cargo install --git https://github.com/paritytech/polkadot-sdk --tag polkadot-v1.9.0 --force staging-chain-spec-builder
tools: polkatool chain-spec-builder

polkatool:
cargo install --git https://github.com/koute/polkavm polkatool

chain-spec-builder:
cargo install --git https://github.com/paritytech/polkadot-sdk --tag polkadot-v1.9.0 staging-chain-spec-builder

fmt:
cargo fmt --all -- --check
cargo fmt --all

check-wasm:
cargo check --no-default-features --target=wasm32-unknown-unknown -p xcq-api -p xcq-executor -p xcq-extension-core -p xcq-extension-fungibles -p xcq-extension -p xcq-primitives -p xcq-runtime-api -p xcq-types
SKIP_WASM_BUILD= cargo check --no-default-features --target=wasm32-unknown-unknown -p poc-runtime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since target is wasm already, is it still needed to set SKIP_WASM_BUILD?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will make the wasm build, but we only want to check


check:
SKIP_WASM_BUILD= cargo check --no-default-features --target=wasm32-unknown-unknown
check: check-wasm
SKIP_WASM_BUILD= cargo check
cd poc/guest; cargo check

Expand Down
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[toolchain]
channel = "1.78.0"
components = ["rust-src", "rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"]