From d32dbed1665e3754dc588fd8b76b70004611d293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Wed, 9 Aug 2023 14:40:17 +0000 Subject: [PATCH] ci: borrow ci setup from eza --- .github/workflows/unit-tests.yml | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..736bd4c --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,46 @@ +name: Unit tests + +on: + push: + branches: [ main ] + paths: + - '.github/workflows/*' + - 'src/**' + - 'Cargo.*' + - build.rs + pull_request: + branches: [ main ] + paths: + - '.github/workflows/*' + - 'src/**' + - 'Cargo.*' + - build.rs + +env: + CARGO_TERM_COLOR: always + +jobs: + unit-tests: + runs-on: ${{ matrix.os }} + + continue-on-error: ${{ matrix.rust == 'nightly' }} + + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + rust: [1.71.0, stable, beta, nightly] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + + - name: Install cargo-hack + run: cargo install cargo-hack@0.5.27 + + - name: Run unit tests + run: cargo hack test --feature-powerset