Afilios/nit 3998 enable erc 20 and erc 721 examples #339
This file contains hidden or 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
name: integration | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
setup-cargo-stylus: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install stable | |
uses: dtolnay/[email protected] | |
- name: Get latest cargo-stylus version | |
id: get-version | |
shell: bash | |
run: | | |
version=$(cargo info cargo-stylus | grep 'version:' | awk 'NR==1 {print $2; exit}') | |
echo "version=$version" >> "$GITHUB_OUTPUT" | |
- name: Cache cargo stylus | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
key: cargo-stylus-${{ steps.get-version.outputs.version }} | |
path: | | |
~/.cargo/bin/cargo-stylus | |
- name: Install cargo-stylus | |
if: steps.cache.outputs.cache-hit != 'true' | |
shell: bash | |
run: | | |
RUSTFLAGS="-C link-args=-rdynamic" cargo install cargo-stylus | |
- name: Archive cargo-stylus binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cargo-stylus-binary | |
path: ~/.cargo/bin/cargo-stylus | |
retention-days: 1 # Keep artifact for 1 day | |
integration-test-example: | |
name: integration-test-example ${{ matrix.test }} (${{ matrix.toolchain }}) | |
runs-on: ubuntu-latest | |
needs: setup-cargo-stylus | |
strategy: | |
matrix: | |
toolchain: [1.88.0, nightly-2025-06-26] | |
test: | |
- "abi_decode" | |
- "abi_encode" | |
- "arrays" | |
- "call" | |
- "caller" | |
- "callee" | |
- "constants" | |
- "constructor" | |
- "custom_storage_slots" | |
- "delegate_call" | |
- "encoding_and_hashing" | |
#- "erc20" | |
#- "erc721" | |
- "errors" | |
- "events" | |
- "fallback_receive" | |
- "first_app" | |
- "function" | |
- "hello_world" | |
- "inheritance" | |
- "mapping" | |
- "nested_structs" | |
- "primitive_data_types" | |
- "sending_ether" | |
- "single_call" | |
- "storage_data_types" | |
- "test" | |
- "variables" | |
- "verify_signature" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install ${{ matrix.toolchain }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
targets: wasm32-unknown-unknown | |
components: rustfmt, rust-src | |
- name: Install cargo-stylus-beta | |
shell: bash | |
run: | | |
cargo install --path ./cargo-stylus | |
- name: Download cargo-stylus binary | |
uses: actions/download-artifact@v4 | |
with: | |
name: cargo-stylus-binary | |
path: ~/.cargo/bin | |
- name: Make cargo-stylus executable | |
shell: bash | |
run: chmod +x ~/.cargo/bin/cargo-stylus | |
- name: Replace rust toolchain file | |
shell: bash | |
run: | | |
FILE=./examples/${{ matrix.test }}/rust-toolchain.toml | |
echo "[toolchain]" > $FILE | |
echo "channel = \"${{ matrix.toolchain }}\"" >> $FILE | |
echo $FILE | |
- name: Run integration tests for ${{ matrix.test }} | |
shell: bash | |
run: ./ci/integration_test.sh --example ${{ matrix.test }} | |
integration-test-stylus-tools: | |
name: integration-test-tools (${{ matrix.toolchain }}) | |
runs-on: ubuntu-latest | |
needs: setup-cargo-stylus | |
strategy: | |
matrix: | |
toolchain: [1.88.0, nightly-2025-06-26] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install ${{ matrix.toolchain }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
targets: wasm32-unknown-unknown | |
- name: Download cargo-stylus binary | |
uses: actions/download-artifact@v4 | |
with: | |
name: cargo-stylus-binary | |
path: ~/.cargo/bin | |
- name: Make cargo-stylus executable | |
shell: bash | |
run: chmod +x ~/.cargo/bin/cargo-stylus | |
- name: Run integration tests for Stylus Tools | |
shell: bash | |
run: ./ci/integration_test.sh --stylus-tools |