From ab3f106797223f88ad2776484b89db2256ddd2dd Mon Sep 17 00:00:00 2001 From: rjtch Date: Wed, 31 Jan 2024 20:19:07 +0100 Subject: [PATCH] feat(ci): added test_ci workflow Signed-off-by: rjtch --- .github/workflows/test.yaml | 29 ++++++++++++++++++++++++----- Makefile | 9 +++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 73e90fb..9d7aee5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -22,16 +22,35 @@ defaults: shell: bash jobs: - test: - name: Run unit tests + tests: + name: Run - test_${{ matrix.test_projects }} runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + test_projects: + - cargo_nextest + - cargo_check + - cargo_machete steps: - uses: actions/checkout@v4 with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: 0 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: nightly - uses: actions/cache@v4 continue-on-error: false + with: + path: | + ~/.cargo/bin + ~/.cargo/registry + ~/.cargo/git/db/ + key: ${{ runner.os }}-sdk-rust-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-sdk-rust- - uses: taiki-e/install-action@v2 with: - tool: nextest,cargo-deny, cargo-msrv, cargo-machete + tool: nextest,cargo-deny, cargo-hack, cargo-machete + - name: Run test ${{ matrix.test_projects }} + run: make -f Makefile test_${{ matrix.test_projects }} diff --git a/Makefile b/Makefile index ca42967..4040e9f 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,15 @@ lint_cargo_toml_fmt_files: lint_cargo_toml_check_files: dprint check --config=tools/dprint/dprint.json +test_cargo_nextest: + cargo nextest run --all-features + +test_cargo_check: + cargo hack check --each-feature --no-dev-deps + +test_cargo_machete: + cargo machete --with-metadata + clean: cargo clean