Skip to content

Commit

Permalink
chore: run boiler on the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
m4tx committed Feb 1, 2024
1 parent dd263fa commit 0d239cf
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 27 deletions.
28 changes: 14 additions & 14 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: cargo
directory: /
schedule:
interval: "monthly"
interval: monthly
groups:
dependencies:
patterns:
- "*"
update-types:
- minor
- patch

- package-ecosystem: "cargo"
directory: "/"
- package-ecosystem: docker
directory: /
schedule:
interval: "monthly"
interval: monthly
groups:
dependencies:
update-types:
- "minor"
- "patch"
- minor
- patch

- package-ecosystem: docker
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
dependencies:
update-types:
- "minor"
- "patch"
patterns:
- "*"
27 changes: 27 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pre-commit checks

on:
push:
pull_request:

jobs:
pre-commit:
# Run on external PRs and pushes to branches on the repo
# This is to avoid double running on PRs from internal branches
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

name: Linting Checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Check files
uses: pre-commit/[email protected]
24 changes: 13 additions & 11 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"

env:
CARGO_TERM_COLOR: always
Expand All @@ -19,8 +19,8 @@ jobs:
build:
strategy:
matrix:
rust: [ stable, nightly ]
os: [ ubuntu-latest, macos-latest ]
rust: [stable, nightly]
os: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:

clippy:
runs-on: ubuntu-latest
needs: [ "build" ]
needs: ["build"]
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -62,16 +62,17 @@ jobs:
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.toml') }}

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@beta
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy

- name: Run clippy
run: cargo clippy -- -Dclippy::all

coverage:
runs-on: ubuntu-latest
needs: [ "build" ]
needs: ["build"]
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -93,8 +94,8 @@ jobs:
- name: Test
run: cargo test --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Cinstrument-coverage'
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Cinstrument-coverage"

- name: Install grcov
uses: baptiste0928/cargo-install@v2
Expand All @@ -104,16 +105,17 @@ jobs:
- name: Run grcov
run: grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov

- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
files: ./coverage.lcov
flags: rust
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

rustfmt:
runs-on: ubuntu-latest
needs: [ "build" ]
needs: ["build"]
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand Down
16 changes: 14 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,28 @@ repos:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-toml
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
args: [ "--fix=lf" ]
args: ["--fix=lf"]
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
types_or: [json, yaml]

- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt

- repo: https://github.com/AleksaC/hadolint-py
rev: v2.12.0.3
hooks:
- id: hadolint
files: (Dockerfile|.dockerfile)$
types: [text]

0 comments on commit 0d239cf

Please sign in to comment.