Skip to content

Merge contract testing library #3

Merge contract testing library

Merge contract testing library #3

name: "Testing library: Format, lint, build, and test"
# This job runs:
# - rustfmt
# - clippy linting
# - tests
# for the smart contract testing library.
on:
push:
branches: main
pull_request:
branches: main
types:
- opened
- reopened
- synchronize
- ready_for_review
paths:
- 'contract-testing/**/*.rs'
- 'contract-testing/**/*.toml'
- 'rustfmt.toml'
- 'concordium-rust-sdk'
workflow_dispatch: # allows manual trigger
env:
RUST_FMT: nightly-2023-04-01-x86_64-unknown-linux-gnu
RUST_CLIPPY: 1.66
jobs:
"lint_fmt":
name: ${{ matrix.build-dir }} lint:fmt
# Don't run on draft pull requests
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
strategy:
matrix:
build-dir:
- 'concordium-smart-contract-testing'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_FMT }}
override: true
components: rustfmt
- name: Format
working-directory: ${{ matrix.build-dir }}
run: |
cargo fmt -- --color=always --check
"lint_clippy":
name: ${{ matrix.build-dir }} lint:clippy
# Don't run on draft pull requests
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
strategy:
matrix:
build-dir:
- 'concordium-smart-contract-testing'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_CLIPPY }}
override: true
components: clippy
- name: Clippy
working-directory: ${{ matrix.build-dir }}
run: |
git config --global url."https://github.com/".insteadOf "[email protected]:"
cargo clippy --color=always --tests --benches -- -Dclippy::all
"cargo_test":
name: ${{ matrix.build-dir }} cargo:test
runs-on: ubuntu-latest
needs:
- cargo-concordium_cargo_build-bench

Check failure on line 88 in .github/workflows/linter-testing-lib.yaml

View workflow run for this annotation

GitHub Actions / Testing library: Format, lint, build, and test

Invalid workflow file

The workflow is not valid. .github/workflows/linter-testing-lib.yaml (Line: 88, Col: 9): Job 'cargo_test' depends on unknown job 'cargo-concordium_cargo_build-bench'.
strategy:
matrix:
build-dir:
- 'concordium-smart-contract-testing'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_CLIPPY }}
override: true
- name: Test
working-directory: ${{ matrix.build-dir }}
run: cargo test -- --skip io_tests # Skip the I/O tests in the testing library.