Skip to content
Open
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
22 changes: 19 additions & 3 deletions .github/workflows/check-abi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,36 @@ concurrency:
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
jobs:
check-abi:
name: Check ABI
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Install rust
- name: Install Rust toolchain
Copy link
Collaborator

Choose a reason for hiding this comment

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

The name changes are useful, but the additional caching steps don't seem to be reducing the run time 🤔
Maybe I'm missing something?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. We need to research that later and address this pr towards main

uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
cache: true

- name: Cache cargo-stylus binary
id: cache-cargo-stylus
uses: actions/cache@v4
with:
path: ~/.cargo/bin/cargo-stylus
key: cargo-stylus-0.6.3-${{ runner.os }}

- name: Install cargo-stylus
if: steps.cache-cargo-stylus.outputs.cache-hit != 'true'
run: cargo install --locked --force [email protected]

- name: Run export-abi
- name: Verify cargo-stylus installation
run: cargo stylus --version

- name: Run export-abi check
run: ./scripts/check-abi.sh
32 changes: 23 additions & 9 deletions .github/workflows/check-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,37 @@ concurrency:
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
jobs:
check-package:
name: Check package
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
package:
- openzeppelin-crypto
- openzeppelin-stylus-proc
- openzeppelin-stylus
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Install rust
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
cache: true
target: wasm32-unknown-unknown

- name: Check openzeppelin-crypto
run: cargo package -p openzeppelin-crypto --target wasm32-unknown-unknown
- name: Check package ${{ matrix.package }}
run: cargo package -p ${{ matrix.package }} --target wasm32-unknown-unknown

- name: Check openzeppelin-stylus-proc
run: cargo package -p openzeppelin-stylus-proc --target wasm32-unknown-unknown

- name: Check openzeppelin-stylus
run: cargo package -p openzeppelin-stylus --target wasm32-unknown-unknown
- name: Verify package contents
run: |
crate_file=$(find target/package -name "${{ matrix.package }}-*.crate" | head -1)
if [ -z "$crate_file" ]; then
exit 1
fi
23 changes: 20 additions & 3 deletions .github/workflows/check-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,37 @@ concurrency:
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
jobs:
check-wasm:
name: Check WASM binary
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Install rust
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
cache: true
target: wasm32-unknown-unknown

- name: Cache cargo-stylus binary
id: cache-cargo-stylus
uses: actions/cache@v4
with:
path: ~/.cargo/bin/cargo-stylus
key: cargo-stylus-0.6.3-${{ runner.os }}

- name: Install cargo-stylus
if: steps.cache-cargo-stylus.outputs.cache-hit != 'true'
run: cargo install --locked --force [email protected]

- name: Run wasm check
- name: Verify cargo-stylus installation
run: cargo stylus --version

- name: Run WASM check
run: ./scripts/check-wasm.sh
55 changes: 36 additions & 19 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,36 @@ concurrency:
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
jobs:
fmt:
runs-on: ubuntu-latest
name: nightly / fmt
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Install rust
- name: Install Rust nightly
# We run in nightly to make use of some features only available there.
# Check out `rustfmt.toml` to see which ones.
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2025-08-01
components: rustfmt
rustflags: ""
cache: true

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

clippy:
runs-on: ubuntu-latest
name: ${{ matrix.toolchain }} / clippy
timeout-minutes: 20
permissions:
contents: read
checks: write
Expand All @@ -57,41 +63,47 @@ jobs:
# channels.
toolchain: [stable, beta]
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Install rust ${{ matrix.toolchain }}
- name: Install Rust ${{ matrix.toolchain }}
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
rustflags: ""
cache: true

- name: Cargo clippy
uses: giraffate/clippy-action@v1
with:
reporter: "github-pr-check"
github_token: ${{ secrets.GITHUB_TOKEN }}

doc:
# Run docs generation on nightly rather than stable. This enables features
# like https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html
# which allows an API be documented as only available in some specific
# platforms.
runs-on: ubuntu-latest
name: nightly / doc
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Install rust
- name: Install Rust nightly
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2025-08-01
rustflags: ""
cache: true

- name: Cargo doc
- name: Generate Rust documentation
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: --cfg docsrs
Expand All @@ -101,58 +113,63 @@ jobs:
# are all additive which is required for feature unification.
runs-on: ubuntu-latest
name: ubuntu / stable / features
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Install rust
- name: Install Rust stable
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
rustflags: ""
cache: true

- name: Cargo install cargo-hack
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
# Intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4
# `--feature-powerset` runs for every combination of features. Note that
# target in this context means one of `--lib`, `--bin`, etc, and not the
# target triple.
- name: Cargo hack
- name: Run feature powerset check
run: cargo hack check --feature-powerset --depth 2 --release --target wasm32-unknown-unknown --workspace --exclude e2e --exclude basic-script-example --exclude benches

typos:
runs-on: ubuntu-latest
name: ubuntu / stable / typos
timeout-minutes: 5
steps:
- name: Checkout Actions Repository
- name: Checkout code
uses: actions/checkout@v4

- name: Check spelling of files in the workspace
- name: Check spelling
uses: crate-ci/typos@v1

nostd:
# This job checks whether the library is able to run without the std
# library.
runs-on: ubuntu-latest
name: ${{ matrix.target }}
timeout-minutes: 15
strategy:
matrix:
target: [wasm32-unknown-unknown]
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Install rust
- name: Install Rust stable
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
rustflags: ""
cache: true
target: ${{ matrix.target }}

- name: Add rust targets ${{ matrix.target }}
run: rustup target add ${{ matrix.target }}

- name: Cargo check
- name: Check no-std compatibility
run: cargo check --release --target ${{ matrix.target }} --no-default-features
25 changes: 21 additions & 4 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,41 @@ concurrency:
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
jobs:
required:
name: tests
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Install rust
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-key: "e2e-tests"
rustflags: ""
cache: true
target: wasm32-unknown-unknown

- name: Cache cargo-stylus binary
id: cache-cargo-stylus
uses: actions/cache@v4
with:
path: ~/.cargo/bin/cargo-stylus
key: cargo-stylus-0.6.3-${{ runner.os }}

- name: Install cargo-stylus
if: steps.cache-cargo-stylus.outputs.cache-hit != 'true'
run: cargo install --locked --force [email protected]

- name: Setup nitro node
- name: Verify cargo-stylus installation
run: cargo stylus --version

- name: Setup nitro testnode
run: ./scripts/nitro-testnode.sh -d -i

- name: run integration tests
- name: Run integration tests
run: ./scripts/e2e-tests.sh
Loading
Loading