From f7e3097773a3f3ceafd4094ab46f8181faa8f491 Mon Sep 17 00:00:00 2001 From: Jeroen Van Der Donckt Date: Sat, 5 Nov 2022 12:49:17 +0100 Subject: [PATCH] :robot: add CI-CD --- .github/workflows/test.yaml | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..1cd8f60 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,51 @@ +name: Test + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + name: argminmax test + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ['windows-latest', 'macOS-latest', 'ubuntu-latest'] + rust: ['stable', 'beta', 'nightly'] + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + components: clippy, rustfmt + + - name: Rust toolchain info + run: | + cargo --version --verbose + rustc --version + cargo clippy --version + cargo fmt --version + + - name: Linting + run: | + cargo fmt -- --check + cargo clippy --features half -- -D warnings + + - name: Cache Dependencies + uses: Swatinem/rust-cache@v1 + + - name: Run cargo-tarpaulin + uses: actions-rs/tarpaulin@v0.1 + with: + args: '--features half -- --test-threads 1' + + - name: Upload to codecov.io + uses: codecov/codecov-action@v3