From 32b4c676eca12f2d8a1ba3c9cf3c0d453e4c74c8 Mon Sep 17 00:00:00 2001 From: Andrej Orsula Date: Sat, 9 Mar 2024 15:12:10 +0100 Subject: [PATCH] Update Dependabot automation (#18) * Update Dependabot automation Signed-off-by: Andrej Orsula * Update Rust CI to maintain name for `cargo (MSRV)` job Signed-off-by: Andrej Orsula --------- Signed-off-by: Andrej Orsula --- .github/workflows/dependabot.yml | 22 ++++------------------ .github/workflows/rust.yml | 13 ++++++++++++- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index 544bfee..b8349c1 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -1,15 +1,12 @@ name: Dependabot automation -on: - pull_request: - check_run: - types: [completed] +on: pull_request permissions: contents: write pull-requests: write jobs: - approve: + dependabot_automation: runs-on: ubuntu-latest if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }} steps: @@ -18,23 +15,12 @@ jobs: uses: dependabot/fetch-metadata@v1 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Approve PR + - name: Approve the PR env: PR_URL: ${{github.event.pull_request.html_url}} GH_TOKEN: ${{secrets.GITHUB_TOKEN}} run: gh pr review --approve "$PR_URL" - - auto_merge: - runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'check_run' }} - steps: - - name: Fetch metadata - id: metadata - uses: dependabot/fetch-metadata@v1 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Enable PR auto-merge - if: steps.metadata.outputs.update-type == 'version-update:semver-patch' + - name: Enable auto-merge for the PR env: PR_URL: ${{github.event.pull_request.html_url}} GH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bf4eaa6..9226e1e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,6 +14,7 @@ concurrency: cancel-in-progress: true env: + MSRV: "1.74" PYTHON_VERSION: "3.10" CARGO_TERM_COLOR: always LIB_PACKAGE_NAME: pyo3_bindgen @@ -41,7 +42,7 @@ jobs: fail-fast: false matrix: toolchain: - - "1.74" # Minimal supported Rust version (MSRV) + - MSRV - stable - beta steps: @@ -50,9 +51,19 @@ jobs: with: save-if: ${{ github.event_name == 'push'}} - uses: dtolnay/rust-toolchain@master + if: ${{ matrix.toolchain != 'MSRV' && matrix.toolchain != 'stable' }} + with: + toolchain: ${{ matrix.toolchain }} + - uses: dtolnay/rust-toolchain@master + if: ${{ matrix.toolchain == 'MSRV' }} + with: + toolchain: ${{ env.MSRV }} + - uses: dtolnay/rust-toolchain@master + if: ${{ matrix.toolchain == 'stable' }} with: toolchain: ${{ matrix.toolchain }} components: clippy + - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }}