Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
chore(ci): add rustfmt checks and fix format issues (#22)
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Delgado <lorenzo@edgeandnode.com>
  • Loading branch information
LNSD authored Jun 4, 2024
1 parent e94e0f1 commit 8525921
Show file tree
Hide file tree
Showing 10 changed files with 632 additions and 26 deletions.
109 changes: 109 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
extends: [
'config:recommended',
':semanticCommits',
':semanticCommitTypeAll(chore)',
'helpers:pinGitHubActionDigests',
],
schedule: [
'before 6am on Monday',
],
configMigration: true,
rebaseWhen: 'behind-base-branch',
lockFileMaintenance: {
enabled: true,
},
packageRules: [
{
groupName: 'futures crates',
groupSlug: 'futures',
matchManagers: [
'cargo',
],
matchPackageNames: [
'futures',
],
matchPackagePrefixes: [
'futures-',
'futures_',
],
},
{
groupName: 'serde crates',
groupSlug: 'serde',
matchManagers: [
'cargo',
],
matchPackageNames: [
'serde',
],
matchPackagePrefixes: [
'serde-',
'serde_',
],
},
{
groupName: 'tonic crates',
groupSlug: 'tonic',
matchManagers: [
'cargo',
],
matchSourceUrlPrefixes: [
'https://github.com/hyperium/tonic',
'https://github.com/tokio-rs/prost',
],
},
{
groupName: 'tracing crates',
groupSlug: 'tracing',
matchManagers: [
'cargo',
],
matchSourceUrlPrefixes: [
'https://github.com/tokio-rs/tracing',
],
matchPackagePrefixes: [
'tracing-',
'tracing_',
],
},
{
groupName: 'alloy-rs core types monorepo',
groupSlug: 'alloy-core',
matchManagers: [
'cargo',
],
matchSourceUrlPrefixes: [
'https://github.com/alloy-rs/core',
],
},
{
groupName: 'async-graphql crates',
groupSlug: 'async-graphql',
matchManagers: [
'cargo',
],
matchPackageNames: [
'async-graphql',
],
matchPackagePrefixes: [
'async-graphql-',
],
},
],
customManagers: [
{
customType: 'regex',
fileMatch: [
'^rust-toolchain(\\.toml)?$',
],
matchStrings: [
'channel\\s*=\\s*"(?<currentValue>\\d+\\.\\d+\\.\\d+)"',
],
depNameTemplate: 'rust',
packageNameTemplate: 'rust-lang/rust',
datasourceTemplate: 'github-releases',
},
],
}
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: ci
on:
pull_request:
push:
branches: [ main ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
GH_USER: ${{ github.repository_owner }}
GH_TOKEN: ${{ secrets.GH_PRIVATE_TOKEN }}

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4

- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy

- name: Cache rust build files
uses: Leafwing-Studios/cargo-cache@c7e8aa40ae2c975774d3bd766beb92927cfd7771 # v1

- name: check (release)
run: cargo check --workspace --all-targets --all-features --release

- name: clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings --force-warn deprecated --force-warn dead-code

- name: unit-tests
run: cargo test --all-features --lib

format:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4

- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt

- run: cargo +nightly fmt --all -- --check
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
/target
Cargo.lock
## IDEs and Editors
.idea/
.vscode/

## Rust
debug/
target/
**/*.rs.bk
*.pdb
Loading

0 comments on commit 8525921

Please sign in to comment.