Skip to content

Commit d14566b

Browse files
authored
Merge pull request #879 from sanders41/install-rust
Use the install rust action in github actions
2 parents 3b52b3d + 1f0f49a commit d14566b

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

src/github_actions.rs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,7 @@ jobs:
284284
steps:
285285
- uses: actions/checkout@v5
286286
- name: Install Rust
287-
run: |
288-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
287+
uses: dtolnay/rust-toolchain@stable
289288
- name: Cache dependencies
290289
uses: Swatinem/rust-cache@v2
291290
- name: Run cargo clippy
@@ -296,8 +295,7 @@ jobs:
296295
steps:
297296
- uses: actions/checkout@v5
298297
- name: Install Rust
299-
run: |
300-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
298+
uses: dtolnay/rust-toolchain@stable
301299
- name: Cache dependencies
302300
uses: Swatinem/rust-cache@v2
303301
- name: Run cargo fmt
@@ -368,8 +366,7 @@ jobs:
368366
steps:
369367
- uses: actions/checkout@v5
370368
- name: Install Rust
371-
run: |
372-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
369+
uses: dtolnay/rust-toolchain@stable
373370
- name: Cache dependencies
374371
uses: Swatinem/rust-cache@v2
375372
- name: Run cargo clippy
@@ -380,8 +377,7 @@ jobs:
380377
steps:
381378
- uses: actions/checkout@v5
382379
- name: Install Rust
383-
run: |
384-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
380+
uses: dtolnay/rust-toolchain@stable
385381
- name: Cache dependencies
386382
uses: Swatinem/rust-cache@v2
387383
- name: Run cargo fmt
@@ -634,8 +630,7 @@ jobs:
634630
steps:
635631
- uses: actions/checkout@v5
636632
- name: Install Rust
637-
run: |
638-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
633+
uses: dtolnay/rust-toolchain@stable
639634
- name: Cache dependencies
640635
uses: Swatinem/rust-cache@v2
641636
- name: Run cargo clippy
@@ -646,8 +641,7 @@ jobs:
646641
steps:
647642
- uses: actions/checkout@v5
648643
- name: Install Rust
649-
run: |
650-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
644+
uses: dtolnay/rust-toolchain@stable
651645
- name: Cache dependencies
652646
uses: Swatinem/rust-cache@v2
653647
- name: Run cargo fmt
@@ -719,8 +713,7 @@ jobs:
719713
steps:
720714
- uses: actions/checkout@v5
721715
- name: Install Rust
722-
run: |
723-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
716+
uses: dtolnay/rust-toolchain@stable
724717
- name: Cache dependencies
725718
uses: Swatinem/rust-cache@v2
726719
- name: Run cargo clippy
@@ -731,8 +724,7 @@ jobs:
731724
steps:
732725
- uses: actions/checkout@v5
733726
- name: Install Rust
734-
run: |
735-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
727+
uses: dtolnay/rust-toolchain@stable
736728
- name: Cache dependencies
737729
uses: Swatinem/rust-cache@v2
738730
- name: Run cargo fmt

src/snapshots/python_project__github_actions__tests__save_ci_testing_linux_only_file_pyo3.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: src/github_actions.rs
33
expression: content
44
---
5-
"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.9\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n run: |\n curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n run: |\n curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install uv\n uses: astral-sh/setup-uv@v6\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.9\", \"3.10\", \"3.11\", \"3.12\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install uv\n uses: astral-sh/setup-uv@v6\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Test with pytest\n run: uv run pytest\n"
5+
"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.9\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install uv\n uses: astral-sh/setup-uv@v6\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.9\", \"3.10\", \"3.11\", \"3.12\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install uv\n uses: astral-sh/setup-uv@v6\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Test with pytest\n run: uv run pytest\n"

src/snapshots/python_project__github_actions__tests__save_ci_testing_multi_os_file_pyo3.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: src/github_actions.rs
33
expression: content
44
---
5-
"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.9\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n run: |\n curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n run: |\n curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install uv\n uses: astral-sh/setup-uv@v6\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.9\", \"3.10\", \"3.11\", \"3.12\"]\n os: [ubuntu-latest, windows-latest, macos-latest]\n runs-on: ${{ matrix.os }}\n steps:\n - uses: actions/checkout@v5\n - name: Install uv\n uses: astral-sh/setup-uv@v6\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Test with pytest\n run: uv run pytest\n"
5+
"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.9\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install uv\n uses: astral-sh/setup-uv@v6\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.9\", \"3.10\", \"3.11\", \"3.12\"]\n os: [ubuntu-latest, windows-latest, macos-latest]\n runs-on: ${{ matrix.os }}\n steps:\n - uses: actions/checkout@v5\n - name: Install uv\n uses: astral-sh/setup-uv@v6\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Test with pytest\n run: uv run pytest\n"

0 commit comments

Comments
 (0)