Merge pull request #32 from diadata-org/randomoracle #69
This file contains 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: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
main: | |
name: Run check, test and lints | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Install Rust toolchain | |
uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v1 | |
with: | |
targets: wasm32-unknown-unknown | |
components: clippy rustfmt rust-src | |
- name: Run format checks | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all | |
- name: Run linter | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --all-targets -- --no-deps -D warnings | |
- name: Run cargo check | |
uses: actions-rs/cargo@v1 | |
env: | |
CONTRACTS_NODE: ls # use dummy binary to avoid procmacro error | |
with: | |
command: check | |
args: --all-targets --all-features --manifest-path contracts/oracle/Cargo.toml | |
- name: Run unit test suite | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
- name: Run cargo check example | |
uses: actions-rs/cargo@v1 | |
env: | |
CONTRACTS_NODE: ls # use dummy binary to avoid procmacro error | |
with: | |
command: check | |
args: --all-targets --all-features --manifest-path example/Cargo.toml | |
- name: Run cargo contract check | |
run: >- | |
cargo install cargo-contract && | |
cargo contract check --manifest-path contracts/oracle/Cargo.toml && | |
cargo contract build --manifest-path contracts/oracle/Cargo.toml && | |
cargo contract check --manifest-path example/Cargo.toml && | |
cargo contract build --manifest-path example/Cargo.toml && | |
cargo contract check --manifest-path example-randomness-oracle/Cargo.toml && | |
cargo contract build --manifest-path example-randomness-oracle/Cargo.toml | |