Skip to content

Commit d243903

Browse files
committed
Add clippy and rustfmt components in CI workflows
These now need to be added explicitly in the rust-toolchain action
1 parent 23770ab commit d243903

4 files changed

+27
-3
lines changed

src/github_actions.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,8 @@ jobs:
556556
- uses: actions/checkout@v5
557557
- name: Install Rust
558558
uses: dtolnay/rust-toolchain@stable
559+
with:
560+
components: clippy
559561
- name: Cache dependencies
560562
uses: Swatinem/rust-cache@v2
561563
- name: Run cargo clippy
@@ -567,6 +569,8 @@ jobs:
567569
- uses: actions/checkout@v5
568570
- name: Install Rust
569571
uses: dtolnay/rust-toolchain@stable
572+
with:
573+
components: rustfmt
570574
- name: Cache dependencies
571575
uses: Swatinem/rust-cache@v2
572576
- name: Run cargo fmt
@@ -638,6 +642,8 @@ jobs:
638642
- uses: actions/checkout@v5
639643
- name: Install Rust
640644
uses: dtolnay/rust-toolchain@stable
645+
with:
646+
components: clippy
641647
- name: Cache dependencies
642648
uses: Swatinem/rust-cache@v2
643649
- name: Run cargo clippy
@@ -649,6 +655,8 @@ jobs:
649655
- uses: actions/checkout@v5
650656
- name: Install Rust
651657
uses: dtolnay/rust-toolchain@stable
658+
with:
659+
components: rustfmt
652660
- name: Cache dependencies
653661
uses: Swatinem/rust-cache@v2
654662
- name: Run cargo fmt
@@ -746,6 +754,8 @@ jobs:
746754
- uses: actions/checkout@v5
747755
- name: Install Rust
748756
uses: dtolnay/rust-toolchain@stable
757+
with:
758+
components: clippy
749759
- name: Cache dependencies
750760
uses: Swatinem/rust-cache@v2
751761
- name: Run cargo clippy
@@ -757,6 +767,8 @@ jobs:
757767
- uses: actions/checkout@v5
758768
- name: Install Rust
759769
uses: dtolnay/rust-toolchain@stable
770+
with:
771+
components: rustfmt
760772
- name: Cache dependencies
761773
uses: Swatinem/rust-cache@v2
762774
- name: Run cargo fmt
@@ -854,6 +866,8 @@ jobs:
854866
- uses: actions/checkout@v5
855867
- name: Install Rust
856868
uses: dtolnay/rust-toolchain@stable
869+
with:
870+
components: clippy
857871
- name: Cache dependencies
858872
uses: Swatinem/rust-cache@v2
859873
- name: Run cargo clippy
@@ -865,6 +879,8 @@ jobs:
865879
- uses: actions/checkout@v5
866880
- name: Install Rust
867881
uses: dtolnay/rust-toolchain@stable
882+
with:
883+
components: rustfmt
868884
- name: Cache dependencies
869885
uses: Swatinem/rust-cache@v2
870886
- name: Run cargo fmt
@@ -1200,6 +1216,8 @@ jobs:
12001216
- uses: actions/checkout@v5
12011217
- name: Install Rust
12021218
uses: dtolnay/rust-toolchain@stable
1219+
with:
1220+
components: clippy
12031221
- name: Cache dependencies
12041222
uses: Swatinem/rust-cache@v2
12051223
- name: Run cargo clippy
@@ -1211,6 +1229,8 @@ jobs:
12111229
- uses: actions/checkout@v5
12121230
- name: Install Rust
12131231
uses: dtolnay/rust-toolchain@stable
1232+
with:
1233+
components: rustfmt
12141234
- name: Cache dependencies
12151235
uses: Swatinem/rust-cache@v2
12161236
- name: Run cargo fmt
@@ -1283,6 +1303,8 @@ jobs:
12831303
- uses: actions/checkout@v5
12841304
- name: Install Rust
12851305
uses: dtolnay/rust-toolchain@stable
1306+
with:
1307+
components: clippy
12861308
- name: Cache dependencies
12871309
uses: Swatinem/rust-cache@v2
12881310
- name: Run cargo clippy
@@ -1294,6 +1316,8 @@ jobs:
12941316
- uses: actions/checkout@v5
12951317
- name: Install Rust
12961318
uses: dtolnay/rust-toolchain@stable
1319+
with:
1320+
components: rustfmt
12971321
- name: Cache dependencies
12981322
uses: Swatinem/rust-cache@v2
12991323
- name: Run cargo fmt

src/snapshots/python_project__github_actions__tests__save_ci_testing_fastapi_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\"\n SECRET_KEY: \"someKey\"\n PRODUCTION_MODE: false\n FIRST_SUPERUSER_EMAIL: \"[email protected]\"\n FIRST_SUPERUSER_PASSWORD: \"somePassword1!\"\n FIRST_SUPERUSER_NAME: \"Super User\"\n POSTGRES_HOST: \"127.0.0.1\"\n POSTGRES_USER: \"postgres\"\n POSTGRES_PASSWORD: \"test_password\"\n POSTGRES_DB: \"test_db\"\n VALKEY_HOST: \"127.0.0.1\"\n VALKEY_PASSWORD: \"test_password\"\n MEILISEARCH_HOST: http://127.0.0.1\n STACK_NAME: \"test-stack\"\n DOMAIN: \"127.0.0.1\"\n LOG_LEVEL: \"DEBUG\"\n CI: true\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 Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Install sqlx-cli\n run: cargo install sqlx-cli --no-default-features -F native-tls -F postgres\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: make .env\n run: touch .env\n - name: Start docker containers\n run: docker compose up db valkey migrations -d\n - name: Test with pytest\n run: uv run pytest -n auto\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\"\n SECRET_KEY: \"someKey\"\n PRODUCTION_MODE: false\n FIRST_SUPERUSER_EMAIL: \"[email protected]\"\n FIRST_SUPERUSER_PASSWORD: \"somePassword1!\"\n FIRST_SUPERUSER_NAME: \"Super User\"\n POSTGRES_HOST: \"127.0.0.1\"\n POSTGRES_USER: \"postgres\"\n POSTGRES_PASSWORD: \"test_password\"\n POSTGRES_DB: \"test_db\"\n VALKEY_HOST: \"127.0.0.1\"\n VALKEY_PASSWORD: \"test_password\"\n MEILISEARCH_HOST: http://127.0.0.1\n STACK_NAME: \"test-stack\"\n DOMAIN: \"127.0.0.1\"\n LOG_LEVEL: \"DEBUG\"\n CI: true\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 with:\n components: clippy\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 with:\n components: rustfmt\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 Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Install sqlx-cli\n run: cargo install sqlx-cli --no-default-features -F native-tls -F postgres\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: make .env\n run: touch .env\n - name: Start docker containers\n run: docker compose up db valkey migrations -d\n - name: Test with pytest\n run: uv run pytest -n auto\n"

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 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"
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 with:\n components: clippy\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 with:\n components: rustfmt\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 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"
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 with:\n components: clippy\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 with:\n components: rustfmt\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)