Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
demosdemon committed Jul 3, 2024
0 parents commit f07eba8
Show file tree
Hide file tree
Showing 25 changed files with 2,949 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[alias]
__vendored = [
"--config",
"source.crates-io.replace-with = \"vendored-sources\"",
"--frozen",
"--offline",
]

v-check = "__vendored check"
v-clippy = "__vendored clippy"
v-build = "__vendored build"
v-run = "__vendored run"
v-test = "__vendored test"

v = "vendor --verbose --versioned-dirs"

[source.vendored-sources]
directory = "vendor"
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: ci
on:
pull_request:
push:
branches:
- main

env:
RUST_BACKTRACE: "1"

jobs:
style:
name: Check Style
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Rust (nightly)
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt

- run: cargo fmt --all --check

check-and-test:
name: Run Clippy Checks and Tests
needs: [style]
strategy:
matrix:
os:
- ubuntu-latest
# - macos-latest
# - windows-latest
rust:
# - stable
# - beta
- nightly
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: "-D warnings"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Rust (${{ matrix.rust }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: clippy

- name: Setup Cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: v0-rust
shared-key: ${{ matrix.os }}-${{ matrix.rust }}

- name: Run Clippy (no default features)
run: cargo clippy --workspace --tests --no-default-features

- name: Run Clippy (default features)
run: cargo clippy --workspace --tests

- name: Run Clippy (all features)
run: cargo clippy --workspace --tests --all-features

- name: Run Tests (no default features)
run: cargo test --workspace --no-default-features

- name: Run Tests (default features)
run: cargo test --workspace

- name: Run Tests (all features)
run: cargo test --workspace --all-features
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
# Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# Do not ignore anything inside of `vendor`
!vendor/**
9 changes: 9 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
format_macro_matchers = true
group_imports = "StdExternalCrate"
imports_granularity = "Item"
normalize_comments = true
normalize_doc_attributes = true
overflow_delimited_expr = true
use_field_init_shorthand = true
use_try_shorthand = true
wrap_comments = true
Loading

0 comments on commit f07eba8

Please sign in to comment.