Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/actions/get-msrv/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Get MSRV
description: Get the Minimum Supported Rust Version from Cargo.toml

outputs:
msrv:
description: The MSRV extracted from Cargo.toml
value: ${{ steps.get-msrv.outputs.msrv }}

runs:
using: composite
steps:
- name: Get MSRV
id: get-msrv
shell: bash
run: |
msrv=$(grep '^rust-version' Cargo.toml | sed 's/.*"\(.*\)".*/\1/')
echo "msrv=$msrv" >> $GITHUB_OUTPUT
echo "MSRV is $msrv"
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

env:
rust_msrv: "1.87"

jobs:
check:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -184,10 +181,13 @@ jobs:
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Get MSRV
id: get-msrv
uses: ./.github/actions/get-msrv
- name: Setup MSRV Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ env.rust_msrv }}
rust-version: ${{ steps.get-msrv.outputs.msrv }}
- name: Setup Nightly Rust toolchain
uses: ./.github/actions/setup-builder
- name: Check MSRV
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
workflow_dispatch:

env:
rust_msrv: "1.87"

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -48,10 +45,14 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Get MSRV
id: get-msrv
uses: ./.github/actions/get-msrv

- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ env.rust_msrv }}
rust-version: ${{ steps.get-msrv.outputs.msrv }}

- name: Publish ${{ matrix.package }}
working-directory: ${{ matrix.package }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ on:
- completed
workflow_dispatch:

env:
rust_msrv: "1.87"

concurrency:
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }}-${{ github.event_name }}
cancel-in-progress: true
Expand Down Expand Up @@ -147,10 +144,14 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: 3.12
- name: Get MSRV
id: get-msrv
uses: ./.github/actions/get-msrv

- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ env.rust_msrv }}
rust-version: ${{ steps.get-msrv.outputs.msrv }}
- uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release_python_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ on:
- cron: "0 0 * * *" # Runs at midnight UTC every day
workflow_dispatch: # Allows manual triggering

env:
rust_msrv: "1.87"

permissions:
contents: read

Expand Down Expand Up @@ -88,10 +85,14 @@ jobs:
with:
python-version: 3.12

- name: Get MSRV
id: get-msrv
uses: ./.github/actions/get-msrv

- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ env.rust_msrv }}
rust-version: ${{ steps.get-msrv.outputs.msrv }}

- uses: PyO3/maturin-action@v1
with:
Expand Down