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: Builds unit test binary and run unit tests, runs static rust code analysis and code formatting | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
main: | |
name: Run check, test and lints | |
runs-on: [self-hosted, Linux, X64, large] | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTC_WRAPPER: sccache | |
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 | |
- name: Run Format Checks | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all | |
- name: Run Linter | |
uses: actions-rs/cargo@v1 | |
env: | |
# https://github.com/mozilla/sccache/issues/966 | |
RUSTC_WRAPPER: "" | |
RUSTC_WORKSPACE_WRAPPER: sccache | |
with: | |
command: clippy | |
args: --all-targets -- --no-deps -D warnings | |
- name: Run Unit Test Suite | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test |