Skip to content

Commit

Permalink
chore: Update from _rust/main template
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Apr 26, 2024
2 parents 5c3a98e + 181a2cf commit 777e115
Show file tree
Hide file tree
Showing 15 changed files with 188 additions and 216 deletions.
3 changes: 1 addition & 2 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
msrv = "1.64.0" # MSRV
warn-on-all-wildcard-imports = true
allow-print-in-tests = true
allow-expect-in-tests = true
allow-unwrap-in-tests = true
allow-dbg-in-tests = true
Expand Down
18 changes: 10 additions & 8 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
'before 5am on the first day of the month',
],
semanticCommits: 'enabled',
commitMessageLowerCase: 'never',
configMigration: true,
dependencyDashboard: true,
customManagers: [
Expand All @@ -17,29 +18,28 @@
'^\\.github/workflows/rust-next.yml$',
],
matchStrings: [
'MSRV.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?MSRV',
'STABLE.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?STABLE',
],
depNameTemplate: 'rust',
depNameTemplate: 'STABLE',
packageNameTemplate: 'rust-lang/rust',
datasourceTemplate: 'github-releases',
},
],
packageRules: [
{
commitMessageTopic: 'MSRV',
commitMessageTopic: 'Rust Stable',
matchManagers: [
'regex',
'custom.regex',
],
matchPackageNames: [
'rust',
'STABLE',
],
minimumReleaseAge: '336 days', // 8 releases * 6 weeks per release * 7 days per week
internalChecksFilter: 'strict',
extractVersion: '^(?<version>\\d+\\.\\d+)', // Drop the patch version
schedule: [
'* * * * *',
],
automerge: true,
},
// Goals:
// - Keep version reqs low, ignoring compatible normal/build dependencies
Expand Down Expand Up @@ -72,6 +72,7 @@
matchCurrentVersion: '>=1.0.0',
matchUpdateTypes: [
'minor',
'patch',
],
enabled: false,
},
Expand Down Expand Up @@ -99,6 +100,7 @@
matchCurrentVersion: '>=1.0.0',
matchUpdateTypes: [
'minor',
'patch',
],
automerge: true,
groupName: 'compatible (dev)',
Expand Down
46 changes: 15 additions & 31 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,34 +56,18 @@ labels:
description: "Call for participation: Help is requested to fix this issue."
color: '#02E10C'

branches:
- name: main
protection:
required_pull_request_reviews: null
required_conversation_resolution: true
required_status_checks:
# Required. Require branches to be up to date before merging.
strict: false
contexts: ["CI", "Lint Commits", "Spell Check with Typos"]
enforce_admins: false
restrictions: null
- name: v0.4-main
protection:
required_pull_request_reviews: null
required_conversation_resolution: true
required_status_checks:
# Required. Require branches to be up to date before merging.
strict: false
contexts: ["CI", "Lint Commits", "Spell Check with Typos"]
enforce_admins: false
restrictions: null
- name: v0.3-main
protection:
required_pull_request_reviews: null
required_conversation_resolution: true
required_status_checks:
# Required. Require branches to be up to date before merging.
strict: false
contexts: ["CI", "Lint Commits", "Spell Check with Typos"]
enforce_admins: false
restrictions: null
# This serves more as documentation.
# Branch protection API was replaced by rulesets but settings isn't updated.
# See https://github.com/repository-settings/app/issues/825
#
# branches:
# - name: main
# protection:
# required_pull_request_reviews: null
# required_conversation_resolution: true
# required_status_checks:
# # Required. Require branches to be up to date before merging.
# strict: false
# contexts: ["CI", "Spell Check with Typos"]
# enforce_admins: false
# restrictions: null
4 changes: 4 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ env:
CARGO_TERM_COLOR: always
CLICOLOR: 1

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
security_audit:
permissions:
Expand Down
66 changes: 28 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,27 @@ env:
CARGO_TERM_COLOR: always
CLICOLOR: 1

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
ci:
permissions:
contents: none
name: CI
needs: [test, miri, msrv, docs, rustfmt, clippy]
needs: [test, miri, msrv, lockfile, docs, rustfmt, clippy]
runs-on: ubuntu-latest
if: "always()"
steps:
- name: Done
run: exit 0
- name: Failed
run: exit 1
if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')"
test:
name: Test
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
os: ["ubuntu-latest", "windows-latest", "macos-14"]
rust: ["stable"]
continue-on-error: ${{ matrix.rust != 'stable' }}
runs-on: ${{ matrix.os }}
Expand All @@ -41,14 +47,11 @@ jobs:
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
- name: Build
run: cargo test --no-run --workspace --all-features
- name: Default features
run: cargo test --workspace
- name: All features
run: cargo test --workspace --all-features
- name: No-default features
run: cargo test --workspace --no-default-features
run: cargo test --workspace --no-run
- name: Test
run: cargo hack test --feature-powerset --workspace
miri:
name: Miri
runs-on: ubuntu-latest
Expand All @@ -66,28 +69,19 @@ jobs:
- name: Default features
run: cargo miri test --workspace
msrv:
name: "Check MSRV: 1.64.0"
name: "Check MSRV"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.64" # MSRV
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: "winnow (core)"
run: cargo check --all-targets --no-default-features
- name: "winnow (alloc)"
run: cargo check --all-targets --no-default-features --features alloc
- name: "winnow (std)"
run: cargo check --all-targets
- uses: taiki-e/install-action@cargo-hack
- name: Default features
run: cargo check --workspace --all-targets
- name: All features
run: cargo check --workspace --all-targets --all-features
- name: No-default features
run: cargo check --workspace --all-targets --no-default-features
run: cargo hack check --feature-powerset --locked --rust-version --ignore-private --workspace --all-targets
lockfile:
runs-on: ubuntu-latest
steps:
Expand All @@ -99,7 +93,7 @@ jobs:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: "Is lockfile updated?"
run: cargo fetch --locked
run: cargo update --workspace --locked
docs:
name: Docs
runs-on: ubuntu-latest
Expand All @@ -109,7 +103,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
toolchain: "1.76" # STABLE
- uses: Swatinem/rust-cache@v2
- name: Check documentation
env:
Expand All @@ -124,9 +118,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
# Not MSRV because its harder to jump between versions and people are
# more likely to have stable
toolchain: stable
toolchain: "1.76" # STABLE
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check formatting
Expand All @@ -142,13 +134,13 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.64" # MSRV
toolchain: "1.76" # STABLE
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Install SARIF tools
run: cargo install clippy-sarif --version 0.3.4 --locked # Held back due to msrv
run: cargo install clippy-sarif --locked
- name: Install SARIF tools
run: cargo install sarif-fmt --version 0.3.4 --locked # Held back due to msrv
run: cargo install sarif-fmt --locked
- name: Check
run: >
cargo clippy --workspace --all-features --all-targets --message-format=json -- -D warnings --allow deprecated
Expand All @@ -157,28 +149,26 @@ jobs:
| sarif-fmt
continue-on-error: true
- name: Upload
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: clippy-results.sarif
wait-for-processing: true
- name: Report status
run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated

coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
- name: Run cargo tarpaulin
- name: Gather coverage
run: cargo tarpaulin --output-dir coverage --out lcov
- name: Publish to Coveralls
uses: coverallsapp/github-action@master
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/committed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ env:
CARGO_TERM_COLOR: always
CLICOLOR: 1

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
committed:
name: Lint Commits
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ env:
CARGO_TERM_COLOR: always
CLICOLOR: 1

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
pre-commit:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: pre-commit/action@v3.0.0
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1
44 changes: 15 additions & 29 deletions .github/workflows/rust-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ env:
CARGO_TERM_COLOR: always
CLICOLOR: 1

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
test:
name: Test
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
os: ["ubuntu-latest", "windows-latest", "macos-latest", "macos-14"]
rust: ["stable", "beta"]
include:
- os: ubuntu-latest
Expand All @@ -32,28 +36,11 @@ jobs:
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
- name: Default features
run: cargo test --workspace
- name: All features
run: cargo test --workspace --all-features
- name: No-default features
run: cargo test --workspace --no-default-features
miri:
name: Miri
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: miri
- uses: Swatinem/rust-cache@v2
# no-default features is a subset, not needed
# all-features is `debug` which is extremely slow
- name: Default features
run: cargo miri test --workspace
- uses: taiki-e/install-action@cargo-hack
- name: Build
run: cargo test --workspace --no-run
- name: Test
run: cargo hack test --feature-powerset --workspace
latest:
name: "Check latest dependencies"
runs-on: ubuntu-latest
Expand All @@ -65,11 +52,10 @@ jobs:
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
- name: Update dependencues
run: cargo update
- name: Default features
run: cargo test --workspace
- name: All features
run: cargo test --workspace --all-features
- name: No-default features
run: cargo test --workspace --no-default-features
- name: Build
run: cargo test --workspace --no-run
- name: Test
run: cargo hack test --feature-powerset --workspace
Loading

0 comments on commit 777e115

Please sign in to comment.