Skip to content
Merged
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
93 changes: 29 additions & 64 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
@@ -1,103 +1,68 @@
# 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
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: short
CARGO_TERM_COLOR: always
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"

# TODO: perform other tests on wasi examples
jobs:
test:
name: Wavs Test Suite
name: Test Suite
runs-on: linux-8-core
steps:
- name: Checkout sources
uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install toolchain
uses: actions-rs/toolchain@v1
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: 1.88.0
# target: wasm32-unknown-unknown
override: true

- name: Rust Cache
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
key: test
cache-on-failure: "true"
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: Build tests first
run: cargo test --workspace --no-run --locked

- name: Run tests
uses: actions-rs/cargo@v1
with:
toolchain: 1.88.0
command: test
args: --workspace --locked -- --nocapture
run: cargo test --workspace --locked -- --nocapture --test-threads=4
env:
RUST_BACKTRACE: 1
RUST_LOG: info

lints:
name: Lints
runs-on: ubuntu-latest
lint:
name: Lint
runs-on: linux-8-core
steps:
- name: Checkout sources
uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install toolchain
uses: actions-rs/toolchain@v1
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: 1.88.0
override: true
components: rustfmt, clippy

- name: Rust Cache
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
key: lint
cache-on-failure: "true"
cache-on-failure: true

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Check formatting
run: cargo fmt --all -- --check

- 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
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings