-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #244 from epage/update
refactor(gh): Follow standard template
- Loading branch information
Showing
20 changed files
with
553 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# These settings are synced to GitHub by https://probot.github.io/apps/settings/ | ||
|
||
repository: | ||
description: A logging implementation for `log` which is configured via an environment variable. | ||
homepage: https://docs.rs/env_logger | ||
topics: rust logging | ||
has_issues: true | ||
has_projects: false | ||
has_wiki: false | ||
has_downloads: false | ||
default_branch: main | ||
|
||
allow_squash_merge: true | ||
allow_merge_commit: true | ||
allow_rebase_merge: true | ||
|
||
# Manual: allow_auto_merge: true, see https://github.com/probot/settings/issues/402 | ||
delete_branch_on_merge: true | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Security audit | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '**/Cargo.toml' | ||
- '**/Cargo.lock' | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
RUST_BACKTRACE: 1 | ||
CARGO_TERM_COLOR: always | ||
CLICOLOR: 1 | ||
|
||
jobs: | ||
security_audit: | ||
permissions: | ||
issues: write # to create issues (actions-rs/audit-check) | ||
checks: write # to create check (actions-rs/audit-check) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- uses: actions-rs/audit-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,114 +1,130 @@ | ||
name: Continuous Integration | ||
name: CI | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "**.rs" | ||
- "Cargo.toml" | ||
- "Cargo.lock" | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
RUST_BACKTRACE: 1 | ||
CARGO_TERM_COLOR: always | ||
CLICOLOR: 1 | ||
|
||
jobs: | ||
fmt: | ||
name: Source formatting check | ||
ci: | ||
permissions: | ||
contents: none | ||
name: CI | ||
needs: [test, msrv, docs, rustfmt, clippy] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
components: rustfmt | ||
|
||
- name: Check formatting | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: -- --check | ||
|
||
check: | ||
name: Compilation check | ||
runs-on: ubuntu-latest | ||
- name: Done | ||
run: exit 0 | ||
test: | ||
name: Test | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
rust: | ||
- stable | ||
- beta | ||
- nightly | ||
- 1.41.0 | ||
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | ||
rust: ["stable"] | ||
continue-on-error: ${{ matrix.rust != 'stable' }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
|
||
- name: Run cargo check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
|
||
clippy: | ||
name: Lint check | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
profile: minimal | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- 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 | ||
- name: Check feature combinations | ||
run: cargo run -p ci | ||
- name: Run crate example | ||
run: cargo run --example default | ||
msrv: | ||
name: "Check MSRV: 1.41.0" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
components: clippy | ||
|
||
- name: Run lints | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: -- -D warnings | ||
|
||
ci-crate: | ||
name: CI crate check | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.41.0 # MSRV | ||
profile: minimal | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- 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 | ||
docs: | ||
name: Docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
|
||
- name: Run ci crate | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: run | ||
args: -p ci | ||
|
||
crate-example: | ||
name: Crate example check | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- name: Check documentation | ||
env: | ||
RUSTDOCFLAGS: -D warnings | ||
run: cargo doc --workspace --all-features --no-deps --document-private-items | ||
rustfmt: | ||
name: rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
|
||
- name: Run crate example | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: run | ||
args: --example default | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
# Not MSRV because its harder to jump between versions and people are | ||
# more likely to have stable | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
components: rustfmt | ||
- uses: Swatinem/rust-cache@v1 | ||
- name: Check formatting | ||
run: cargo fmt --all -- --check | ||
clippy: | ||
name: clippy | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write # to create check (actions-rs/audit-check) | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.41.0 # MSRV | ||
profile: minimal | ||
override: true | ||
components: clippy | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --workspace --all-features --all-targets -- -D warnings --allow deprecated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Not run as part of pre-commit checks because they don't handle sending the correct commit | ||
# range to `committed` | ||
name: Lint Commits | ||
on: [pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
RUST_BACKTRACE: 1 | ||
CARGO_TERM_COLOR: always | ||
CLICOLOR: 1 | ||
|
||
jobs: | ||
committed: | ||
name: Lint Commits | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Actions Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Lint Commits | ||
uses: crate-ci/committed@master |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: pre-commit | ||
|
||
permissions: {} # none | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
env: | ||
RUST_BACKTRACE: 1 | ||
CARGO_TERM_COLOR: always | ||
CLICOLOR: 1 | ||
|
||
jobs: | ||
pre-commit: | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/action@v3.0.0 |
Oops, something went wrong.