From 54228d50f2f5d8c9a32507fba4333bd74cff33d3 Mon Sep 17 00:00:00 2001 From: Grzegorz Nosek Date: Tue, 22 Oct 2024 09:33:00 +0200 Subject: [PATCH] new(ci): add a PR workflow to run tests and render docs Signed-off-by: Grzegorz Nosek --- .github/workflows/pr.yaml | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/pr.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 00000000..1f892845 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,46 @@ +name: PR +on: + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test: + name: ${{ matrix.name }} + runs-on: ubuntu-latest + env: + RUSTFLAGS: -D warnings + strategy: + fail-fast: false + matrix: + tag: [ default_features, all_features ] + include: + - tag: default_features + name: Test with default features enabled + cargo_test_opts: "" + - tag: all_features + name: Test with all features enabled + cargo_test_opts: "--all-features" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + - name: Build and test + run: cargo test ${{ matrix.cargo_test_opts }} + + render_docs: + name: Render docs + runs-on: ubuntu-latest + env: + RUSTFLAGS: -D warnings + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + - name: Build docs + run: cargo doc --all-features --no-deps