diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml new file mode 100644 index 0000000..28738b7 --- /dev/null +++ b/.github/workflows/integration_tests.yaml @@ -0,0 +1,39 @@ +# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml + +on: + push: + pull_request: + types: [opened] + +name: Test tube integration tests + +jobs: + test: + name: Test Suite + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install Rust Toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.78.0 + target: wasm32-unknown-unknown + override: true + components: llvm-tools-preview + + - name: Compile WASM contracts + uses: actions-rs/cargo@v1 + with: + command: build + args: --release --lib --target wasm32-unknown-unknown --locked --workspace --exclude testenv + env: + RUSTFLAGS: "-C link-arg=-s" + + - name: Run Integration Tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --features integration diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml deleted file mode 100644 index a671215..0000000 --- a/.github/workflows/rust.yaml +++ /dev/null @@ -1,67 +0,0 @@ -on: push -name: Rust CI -jobs: - check: - name: check - runs-on: ubuntu-latest - steps: - - name: checkout sources - uses: actions/checkout@v2 - - name: install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - name: check for errors - uses: actions-rs/cargo@v1 - with: - command: check - args: --locked - env: - RUST_BACKTRACE: 1 - test: - name: test - runs-on: ubuntu-latest - steps: - - name: checkout sources - uses: actions/checkout@v2 - - name: install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - - name: Compile WASM contracts - uses: actions-rs/cargo@v1 - with: - command: build - args: --release --lib --target wasm32-unknown-unknown --locked --workspace --exclude testenv - env: - RUSTFLAGS: "-C link-arg=-s" - - name: run tests - uses: actions-rs/cargo@v1 - with: - command: unit-test - args: --locked --tests - env: - RUST_BACKTRACE: 1 - clippy: - name: clippy - runs-on: ubuntu-latest - steps: - - name: checkout sources - uses: actions/checkout@v2 - - name: install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - components: clippy - override: true - - name: run linter - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml new file mode 100644 index 0000000..35eddab --- /dev/null +++ b/.github/workflows/unit_tests.yml @@ -0,0 +1,60 @@ +# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml + +on: + push: + pull_request: + types: [opened] + +name: Unit tests + lints + +jobs: + test: + name: Test Suite + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install Rust Toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.78.0 + target: wasm32-unknown-unknown + override: true + components: llvm-tools-preview + + - name: Run Integration Tests + uses: actions-rs/cargo@v1 + with: + command: test + + lints: + name: Lints + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install Rust Toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.78.0 + override: true + components: rustfmt, clippy + + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + - name: Show Clippy version + run: cargo clippy --version + + - name: Run cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --tests -- -D warnings