From 2c1638a80ae18292c790efa107314261c7915700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferry=20J=C3=A9r=C3=A9mie?= Date: Fri, 23 Aug 2024 09:33:25 +0200 Subject: [PATCH] update CI --- .github/workflows/ci.yml | 90 ++++++++++++++++++++++++++++++---------- 1 file changed, 68 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0ce9d8..38f6084 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,30 +1,76 @@ name: CI -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] +on: [push, pull_request] jobs: - build: + test: + name: Test runs-on: ubuntu-latest + + strategy: + matrix: + rust: + - stable + - beta + steps: - - uses: actions/checkout@v2 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - publish: - if: github.repository == 'mothsart/pouf' && startsWith(github.ref, 'refs/tags/') + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install rust (${{ matrix.rust }}) + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + profile: minimal + override: true + + - name: Cache + uses: Swatinem/rust-cache@v1 + + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + args: --verbose ${{ matrix.features }} + + - name: Test + uses: actions-rs/cargo@v1 + with: + command: test + args: --verbose ${{ matrix.features }} + + + coverage: + name: Coverage runs-on: ubuntu-latest + steps: - - uses: katyo/publish-crates@v1 - with: - registry-token: ${{ secrets.CRATES_TOKEN }} - args: --no-verify + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Cache + uses: Swatinem/rust-cache@v1 + + - name: Install cargo-tarpaulin + uses: actions-rs/cargo@v1 + with: + command: install + args: cargo-tarpaulin + + - name: Run cargo tarpaulin + uses: actions-rs/cargo@v1 + with: + command: tarpaulin + args: --output-dir coverage --out lcov + + - name: Publish to Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }}