mirror of
https://github.com/crate-ci/typos.git
synced 2026-10-17 09:35:11 +02:00
Merge pull request #1481 from epage/template
chore: Update from _rust template
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
commitMessageLowerCase: 'never',
|
||||
configMigration: true,
|
||||
dependencyDashboard: true,
|
||||
"pre-commit": {
|
||||
enabled: true
|
||||
},
|
||||
customManagers: [
|
||||
{
|
||||
customType: 'regex',
|
||||
@@ -25,6 +28,18 @@
|
||||
packageNameTemplate: 'rust-lang/rust',
|
||||
datasourceTemplate: 'github-releases',
|
||||
},
|
||||
{
|
||||
customType: 'regex',
|
||||
managerFilePatterns: [
|
||||
'/^\\.github/workflows/pre-commit.yml$/',
|
||||
],
|
||||
matchStrings: [
|
||||
'prek-version.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
|
||||
],
|
||||
depNameTemplate: 'prek',
|
||||
packageNameTemplate: 'j178/prek',
|
||||
datasourceTemplate: 'github-releases',
|
||||
},
|
||||
],
|
||||
packageRules: [
|
||||
{
|
||||
@@ -41,6 +56,20 @@
|
||||
],
|
||||
automerge: true,
|
||||
},
|
||||
{
|
||||
commitMessageTopic: 'Prek',
|
||||
matchManagers: [
|
||||
'custom.regex',
|
||||
],
|
||||
matchDepNames: [
|
||||
'prek',
|
||||
],
|
||||
extractVersion: '^(?<version>\\d+\\.\\d+\\.\\d+)',
|
||||
schedule: [
|
||||
'* * * * *',
|
||||
],
|
||||
automerge: true,
|
||||
},
|
||||
// Goals:
|
||||
// - Rollup safe upgrades to reduce CI runner load
|
||||
// - Have lockfile and manifest in-sync
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- uses: actions-rs/audit-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
checks:
|
||||
- bans licenses sources
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: EmbarkStudios/cargo-deny-action@v2
|
||||
with:
|
||||
command: check ${{ matrix.checks }}
|
||||
|
||||
+22
-25
@@ -44,7 +44,7 @@ jobs:
|
||||
CARGO_PROFILE_DEV_DEBUG: line-tables-only
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
@@ -58,10 +58,13 @@ jobs:
|
||||
run: cargo hack test --each-feature --workspace
|
||||
msrv:
|
||||
name: "Check MSRV"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: ["ubuntu-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
@@ -70,22 +73,16 @@ jobs:
|
||||
- uses: taiki-e/install-action@cargo-hack
|
||||
- name: Default features
|
||||
run: cargo hack check --each-feature --locked --rust-version --ignore-private --workspace --all-targets --keep-going
|
||||
wasm:
|
||||
name: "Check wasm"
|
||||
runs-on: ubuntu-latest
|
||||
minimal-versions:
|
||||
name: Minimal versions
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build: [wasm, wasm-wasi]
|
||||
include:
|
||||
- build: wasm
|
||||
target: wasm32-unknown-unknown
|
||||
- build: wasm-wasi
|
||||
target: wasm32-wasip1
|
||||
os: ["ubuntu-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
- name: Install Rust
|
||||
uses: actions/checkout@v6
|
||||
- name: Install stable Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
@@ -96,7 +93,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
@@ -109,11 +106,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: "1.90" # STABLE
|
||||
toolchain: "1.93" # STABLE
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Check documentation
|
||||
env:
|
||||
@@ -124,15 +121,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: "1.90" # STABLE
|
||||
toolchain: "1.93" # STABLE
|
||||
components: rustfmt
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Check formatting
|
||||
run: cargo fmt --all -- --check
|
||||
run: cargo fmt --check
|
||||
clippy:
|
||||
name: clippy
|
||||
runs-on: ubuntu-latest
|
||||
@@ -140,11 +137,11 @@ jobs:
|
||||
security-events: write # to upload sarif results
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: "1.90" # STABLE
|
||||
toolchain: "1.93" # STABLE
|
||||
components: clippy
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Install SARIF tools
|
||||
@@ -159,7 +156,7 @@ jobs:
|
||||
| sarif-fmt
|
||||
continue-on-error: true
|
||||
- name: Upload
|
||||
uses: github/codeql-action/upload-sarif@v3
|
||||
uses: github/codeql-action/upload-sarif@v4
|
||||
with:
|
||||
sarif_file: clippy-results.sarif
|
||||
wait-for-processing: true
|
||||
@@ -170,7 +167,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Actions Repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Lint Commits
|
||||
|
||||
@@ -22,8 +22,7 @@ jobs:
|
||||
contents: read
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-python@v6
|
||||
- uses: actions/checkout@v6
|
||||
- uses: j178/prek-action@v1
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- uses: pre-commit/action@v3.0.1
|
||||
prek-version: '0.2.27'
|
||||
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
CARGO_PROFILE_DEV_DEBUG: line-tables-only
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
@@ -48,10 +48,15 @@ jobs:
|
||||
run: cargo hack test --each-feature --workspace
|
||||
latest:
|
||||
name: "Check latest dependencies"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: ["ubuntu-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: allow
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
name: Template Update
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '1 1 1 * *'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_TERM_COLOR: always
|
||||
CLICOLOR: 1
|
||||
TEMPLATE_URL: "https://github.com/epage/_rust.git"
|
||||
TEMPLATE_BRANCH: "main"
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update:
|
||||
permissions:
|
||||
security-events: write # to create PR
|
||||
pull-requests: write
|
||||
contents: write # to push the branch
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config --global user.name '${{ github.actor }}'
|
||||
git config --global user.email '<>'
|
||||
- name: Fetch template
|
||||
run: "git remote add template ${{ env.TEMPLATE_URL }} && git fetch template ${{ env.TEMPLATE_BRANCH }}"
|
||||
- name: Merge template
|
||||
run: "git checkout -b template-update && git merge template/${{ env.TEMPLATE_BRANCH }} -m 'chore: Update from template'"
|
||||
- name: Clear any existing branch
|
||||
run: "git push origin --delete template-update"
|
||||
continue-on-error: true
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
- name: Push branch
|
||||
run: "git push --set-upstream origin template-update"
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
- name: Create PR
|
||||
run: "gh pr create --head template-update --title 'chore: Update from template' --body ''"
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
- name: Merge PR
|
||||
run: "gh pr merge --auto --delete-branch"
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
@@ -1,7 +1,7 @@
|
||||
default_install_hook_types: ["pre-commit", "commit-msg"]
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v5.0.0
|
||||
rev: v6.0.0
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
- id: check-json
|
||||
@@ -10,6 +10,6 @@ repos:
|
||||
- id: check-case-conflict
|
||||
- id: detect-private-key
|
||||
- repo: https://github.com/crate-ci/committed
|
||||
rev: v1.1.7
|
||||
rev: v1.1.10
|
||||
hooks:
|
||||
- id: committed
|
||||
|
||||
+1
-2
@@ -38,7 +38,7 @@ create_dir = "warn"
|
||||
dbg_macro = "warn"
|
||||
debug_assert_with_mut_call = "warn"
|
||||
doc_markdown = "warn"
|
||||
empty_enum = "warn"
|
||||
empty_enums = "warn"
|
||||
enum_glob_use = "warn"
|
||||
expl_impl_clone_on_copy = "warn"
|
||||
explicit_deref_methods = "warn"
|
||||
@@ -82,7 +82,6 @@ str_to_string = "warn"
|
||||
string_add = "warn"
|
||||
string_add_assign = "warn"
|
||||
string_lit_as_bytes = "warn"
|
||||
string_to_string = "warn"
|
||||
todo = "warn"
|
||||
trait_duplication_in_bounds = "warn"
|
||||
uninlined_format_args = "warn"
|
||||
|
||||
Reference in New Issue
Block a user