From da5fb471c9dd0a5b69d2b8d2d40a7969238470d9 Mon Sep 17 00:00:00 2001 From: Philipp Hoenisch Date: Mon, 6 Sep 2021 11:36:49 +1000 Subject: [PATCH] Add ci Includes a few checks: - dprint check - clippy - workspace tests on ubuntu and macos --- .github/workflows/ci.yml | 44 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b974ab9..60b7f2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,46 @@ on: - 'master' jobs: - hello_world: + static_analysis: runs-on: ubuntu-latest steps: - - name: print hello world - run: echo "hello world" \ No newline at end of file + - name: Checkout sources + uses: actions/checkout@v2 + - uses: dprint/check@v1.5 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + override: true + toolchain: stable + components: clippy + + - name: Run clippy with default features + run: cargo clippy --workspace --all-targets -- -D warnings + + test_worspace: + strategy: + matrix: + target: [ x86_64-unknown-linux-gnu, x86_64-apple-darwin ] + include: + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + - target: x86_64-apple-darwin + os: macos-latest + runs-on: ${{ matrix.os }} + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + override: true + toolchain: stable + + - uses: Swatinem/rust-cache@v1.3.0 + + - name: Cargo test workspace + run: cargo test --workspace --all-features