diff --git a/.github/workflows/basic-optimized.yml b/.github/workflows/basic-optimized.yml new file mode 100644 index 000000000..c9fa8ab59 --- /dev/null +++ b/.github/workflows/basic-optimized.yml @@ -0,0 +1,82 @@ +on: [pull_request] + +name: Basic Checks (Optimized) + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + RUST_VERSION: 1.88.0 + CARGO_INCREMENTAL: 0 + RUST_BACKTRACE: short + WAVS_SUBMISSION_MNEMONIC: "test test test test test test test test test test test junk" + WAVS_CLI_EVM_CREDENTIAL: "test test test test test test test test test test test junk" + WAVS_AGGREGATOR_CREDENTIAL: "test test test test test test test test test test test junk" + WAVS_COSMOS_SUBMISSION_MNEMONIC: "reward index time stem expire cheap worth fence coil option treat ensure install entry zone mule benefit success remain rebuild inherit eyebrow cluster sheriff" + WAVS_CLI_COSMOS_MNEMONIC: "reward index time stem expire cheap worth fence coil option treat ensure install entry zone mule benefit success remain rebuild inherit eyebrow cluster sheriff" + +jobs: + test: + name: Test ${{ matrix.package }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + max-parallel: 20 + matrix: + package: [wavs-aggregator, utils, wavs-types, wavs-engine, wavs-cli, layer-tests, wavs] + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_VERSION }} + + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 + with: + shared-key: "v0-workspace-${{ hashFiles('**/Cargo.lock') }}" + workspaces: './' + cache-targets: true + cache-directories: | + ~/.cargo/registry/cache + ~/.cargo/registry/index + ~/.cargo/git/db + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - name: Run tests + run: cargo test -p ${{ matrix.package }} --locked -- --nocapture + env: + RUST_LOG: info + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_VERSION }} + components: rustfmt, clippy + + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 + with: + shared-key: "v0-workspace-${{ hashFiles('**/Cargo.lock') }}" + workspaces: './' + cache-targets: true + cache-directories: | + ~/.cargo/registry/cache + ~/.cargo/registry/index + ~/.cargo/git/db + + - name: Check formatting + run: cargo fmt --all -- --check + + - name: Run clippy + run: cargo clippy --all-targets -- -D warnings \ No newline at end of file diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml deleted file mode 100644 index 7837e1af6..000000000 --- a/.github/workflows/basic.yml +++ /dev/null @@ -1,103 +0,0 @@ -# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml - -on: [pull_request] - -name: Basic Checks - -# Ensures that only a single workflow per PR will run at a time. -# Cancels in-progress jobs if new commit is pushed. -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - GO_VERSION: 1.21 - -# TODO: perform other tests on wasi examples -jobs: - test: - name: Wavs Test Suite - runs-on: linux-8-core - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.88.0 - # target: wasm32-unknown-unknown - override: true - - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - with: - key: test - cache-on-failure: "true" - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - - - name: Set env - run: echo "WAVS_SUBMISSION_MNEMONIC=\"test test test test test test test test test test test junk\"" >> $GITHUB_ENV - - - name: Set env - run: echo "WAVS_CLI_EVM_CREDENTIAL=\"test test test test test test test test test test test junk\"" >> $GITHUB_ENV - - - name: Set env - run: echo "WAVS_AGGREGATOR_CREDENTIAL=\"test test test test test test test test test test test junk\"" >> $GITHUB_ENV - - - name: Set env - run: echo "WAVS_COSMOS_SUBMISSION_MNEMONIC=\"reward index time stem expire cheap worth fence coil option treat ensure install entry zone mule benefit success remain rebuild inherit eyebrow cluster sheriff\"" >> $GITHUB_ENV - - - name: Set env - run: echo "WAVS_CLI_COSMOS_MNEMONIC=\"reward index time stem expire cheap worth fence coil option treat ensure install entry zone mule benefit success remain rebuild inherit eyebrow cluster sheriff\"" >> $GITHUB_ENV - - - name: Run tests - uses: actions-rs/cargo@v1 - with: - toolchain: 1.88.0 - command: test - args: --workspace --locked -- --nocapture - env: - RUST_BACKTRACE: 1 - RUST_LOG: info - - lints: - name: Lints - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.88.0 - override: true - components: rustfmt, clippy - - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - with: - key: lint - cache-on-failure: "true" - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - - - name: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - toolchain: 1.88.0 - command: fmt - args: --all -- --check - - - name: Run cargo clippy - uses: actions-rs/cargo@v1 - with: - toolchain: 1.88.0 - command: clippy - args: --all-targets -- -D warnings