diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index b917173..13370a1 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -8,17 +8,11 @@ jobs: coverage: runs-on: ubuntu-latest steps: - - name: Setup Rust + - uses: dtolnay/rust-toolchain@stable id: rust - uses: dtolnay/rust-toolchain@master with: - toolchain: stable components: llvm-tools-preview - - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@v2 - with: - tool: cargo-llvm-cov + - uses: taiki-e/install-action@cargo-llvm-cov - uses: actions/checkout@v4 - run: cargo fetch @@ -27,11 +21,9 @@ jobs: key: coverage-${{ steps.rust.outputs.cachekey }}-${{ hashFiles('**/Cargo.*') }} path: target/ - - name: Run cargo-llvm-cov - run: cargo llvm-cov --all-features --html + - run: cargo llvm-cov --all-features --html - - name: Upload Report - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v4 with: name: coverage-report path: target/llvm-cov/html diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0f53d21..51fcdb3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,4 +1,4 @@ -name: Test and Build Rust +name: Rust on: push: @@ -6,11 +6,7 @@ on: workflow_dispatch: schedule: # Check if it works with current dependencies - - cron: '42 2 * * 6' # weekly on Saturday 2:42 UTC - -env: - CARGO_INCREMENTAL: 0 - CARGO_TERM_COLOR: always + - cron: "42 2 * * 6" # weekly on Saturday 2:42 UTC jobs: rustfmt: @@ -23,7 +19,6 @@ jobs: - run: cargo fmt --check --verbose clippy: - name: Clippy ${{ matrix.toolchain }} runs-on: ubuntu-latest continue-on-error: ${{ (matrix.toolchain == 'beta') || (matrix.toolchain == 'nightly') }} strategy: @@ -36,9 +31,8 @@ jobs: env: RUSTFLAGS: --deny warnings steps: - - name: Setup Rust + - uses: dtolnay/rust-toolchain@master id: rust - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} components: clippy @@ -52,7 +46,6 @@ jobs: - run: cargo doc --offline --all-features --no-deps features: - name: Features ${{ matrix.toolchain }} ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -67,16 +60,11 @@ jobs: env: RUSTFLAGS: --allow unknown-lints --deny warnings steps: - - name: Setup Rust + - uses: dtolnay/rust-toolchain@master id: rust - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} - - - name: Install cargo-hack - uses: taiki-e/install-action@v2 - with: - tool: cargo-hack + - uses: taiki-e/install-action@cargo-hack - uses: actions/checkout@v4 - run: cargo fetch @@ -92,7 +80,6 @@ jobs: run: cargo hack --keep-going --feature-powerset --no-dev-deps check --offline test: - name: Test ${{ matrix.toolchain }} ${{ matrix.os }} runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.toolchain == 'nightly' }} strategy: @@ -107,9 +94,8 @@ jobs: - macos-latest - windows-latest steps: - - name: Setup Rust + - uses: dtolnay/rust-toolchain@master id: rust - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} - uses: actions/checkout@v4 @@ -124,6 +110,8 @@ jobs: release: name: Release ${{ matrix.triple }} runs-on: ${{ matrix.os }} + permissions: + contents: write strategy: fail-fast: false matrix: @@ -151,11 +139,9 @@ jobs: env: RUSTFLAGS: --deny warnings steps: - - name: Setup Rust + - uses: dtolnay/rust-toolchain@stable id: rust - uses: dtolnay/rust-toolchain@master with: - toolchain: stable targets: ${{ matrix.triple }} - name: Install cargo tools @@ -171,5 +157,8 @@ jobs: key: release-${{ matrix.triple }}-${{ steps.rust.outputs.cachekey }}-${{ hashFiles('**/Cargo.*') }} path: target/ - - name: Build - run: ${{ runner.os == 'Linux' && 'cross' || 'cargo' }} build --release --offline --all-features --target ${{ matrix.triple }} + - run: ${{ runner.os == 'Linux' && 'cross' || 'cargo' }} build --release --offline --all-features --target ${{ matrix.triple }} + + - name: Create GitHub release + if: startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v2