Skip to content

Commit 261c9f3

Browse files
committed
Initial commit
0 parents  commit 261c9f3

File tree

9 files changed

+659
-0
lines changed

9 files changed

+659
-0
lines changed

.github/workflows/rust.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
tags:
7+
- '*'
8+
pull_request:
9+
branches: [ "main" ]
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Install package
23+
run: |
24+
rm /etc/apt/apt.conf.d/docker-clean
25+
apt-get update && apt-get -y install
26+
27+
- name: Caching objects
28+
id: cache-objects
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
~/.cargo
33+
${{ github.workspace }}/target
34+
key: ${{ runner.os }}-rust-objects
35+
36+
- name: pre-commit
37+
run: |
38+
pip install pre-commit
39+
pre-commit autoupdate --repo https://github.com/pre-commit/pre-commit-hooks
40+
pre-commit run --all-files
41+
42+
- name: Build
43+
run: cargo build --verbose
44+
45+
- name: Run tests
46+
run: cargo test --verbose
47+
48+
- name: Code coverage
49+
run: |
50+
cargo install cargo-llvm-cov
51+
# rustup component add llvm-tools-preview --toolchain stable-x86_64-unknown-linux-gnu
52+
cargo llvm-cov
53+
54+
# - name: Install Miri
55+
# run: |
56+
# rustup toolchain install nightly --component miri
57+
# rustup override set nightly
58+
# cargo miri setup
59+
# - name: Test with Miri
60+
# run: cargo miri test
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Security audit
2+
on:
3+
push:
4+
paths:
5+
- '**/Cargo.toml'
6+
- '**/Cargo.lock'
7+
jobs:
8+
security_audit:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: rustsec/[email protected]
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.pdb
2+
**/*.rs.bk
3+
debug/
4+
node_modules/
5+
target/

.pre-commit-config.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-byte-order-marker
6+
- id: check-case-conflict
7+
- id: check-case-conflict
8+
- id: check-merge-conflict
9+
- id: check-symlinks
10+
- id: check-toml
11+
- id: check-yaml
12+
- id: end-of-file-fixer
13+
- id: mixed-line-ending
14+
- id: trailing-whitespace
15+
- repo: local
16+
hooks:
17+
- id: fmt
18+
name: fmt
19+
description: Format files with cargo fmt.
20+
entry: cargo fmt --
21+
language: system
22+
files: \.rs$
23+
args: []
24+
- id: cargo-check
25+
name: cargo check
26+
description: Check the package for errors.
27+
entry: cargo check
28+
language: system
29+
files: \.rs$
30+
pass_filenames: false
31+
args: []
32+
- id: cargo-clippy
33+
name: cargo clippy
34+
description: Run the Clippy linter on the package.
35+
entry: cargo clippy -- -D warnings
36+
language: system
37+
files: \.rs$
38+
pass_filenames: false

0 commit comments

Comments
 (0)