Skip to content

Attempt to fix CI.

Attempt to fix CI. #66

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
paths:
- 'smart-contracts/contracts-common/**/*.rs'
- 'smart-contracts/contracts-common/**/*.toml'
- '.github/workflows/build-test-contracts-common.yaml'
pull_request:
branches:
- main
paths:
- 'smart-contracts/contracts-common/**/*.rs'
- 'smart-contracts/contracts-common/**/*.toml'
- '.github/workflows/build-test-contracts-common.yaml'
name: Clippy & fmt
env:
RUST_VERSION: "1.65"
RUST_FMT: "nightly-2023-04-01"
defaults:
run:
working-directory: "./smart-contracts/contracts-common"
jobs:
rustfmt:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Run cargo fmt
run: |
rustup default ${{ env.RUST_FMT }}
rustup component add rustfmt
cargo fmt --all --check
rustdoc:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Run cargo doc
run: |
rustup default ${{ env.RUST_VERSION }}
rustup component add rust-docs
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features --color=always
clippy:
name: Clippy on concordium-contracts-common
runs-on: ubuntu-latest
strategy:
matrix:
features:
- ""
- "std"
- "derive-serde"
- "fuzz"
- "smart-contract"
- "wasm-test"
- "build-schema"
- "concordium-quickcheck"
target:
- wasm32-unknown-unknown
- x86_64-unknown-linux-gnu
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Run cargo clippy
run: |
rustup default ${{ env.RUST_VERSION }}
rustup component add clippy
rustup target add ${{ matrix.target }}
cargo clippy --manifest-path=concordium-contracts-common/Cargo.toml --target=${{ matrix.target }} --features=${{ matrix.features }} --no-default-features -- -D warnings
clippy-on-derive:
name: Clippy on concordium-contracts-common-derive
runs-on: ubuntu-latest
strategy:
matrix:
features:
- ""
- "wasm-test"
- "build-schema"
- "concordium-quickcheck"
target:
- wasm32-unknown-unknown
- x86_64-unknown-linux-gnu
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Run cargo clippy
run: |
rustup default ${{ env.RUST_VERSION }}
rustup component add clippy
rustup target add ${{ matrix.target }}
cargo clippy --manifest-path=concordium-contracts-common-derive/Cargo.toml --target=${{ matrix.target }} --no-default-features -- -D warnings
test:
name: x86_64 tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Run cargo test
run: |
rustup default ${{ env.RUST_VERSION }}
cargo test --workspace --all-features