Skip to content

Commit bf4d5e8

Browse files
josecelanoda2ce7
authored andcommitted
inital version
1 parent 9100cd4 commit bf4d5e8

33 files changed

+5963
-1
lines changed

.cargo/config.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[alias]
2+
cov = "llvm-cov"
3+
cov-lcov = "llvm-cov --lcov --output-path=./.coverage/lcov.info"
4+
cov-html = "llvm-cov --html"
5+
time = "build --timings --all-targets"
6+
7+
[build]
8+
rustflags = [
9+
"-D",
10+
"warnings",
11+
"-D",
12+
"future-incompatible",
13+
"-D",
14+
"let-underscore",
15+
"-D",
16+
"nonstandard-style",
17+
"-D",
18+
"rust-2018-compatibility",
19+
"-D",
20+
"rust-2018-idioms",
21+
"-D",
22+
"rust-2021-compatibility",
23+
"-D",
24+
"unused",
25+
]

.github/workflows/contract.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Contract
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
contract:
12+
name: Contract
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
toolchain: [nightly, stable]
18+
19+
steps:
20+
- id: checkout
21+
name: Checkout Repository
22+
uses: actions/checkout@v4
23+
24+
- id: setup
25+
name: Setup Toolchain
26+
uses: dtolnay/rust-toolchain@stable
27+
with:
28+
toolchain: ${{ matrix.toolchain }}
29+
components: llvm-tools-preview
30+
31+
- id: cache
32+
name: Enable Job Cache
33+
uses: Swatinem/rust-cache@v2
34+
35+
- id: tools
36+
name: Install Tools
37+
uses: taiki-e/install-action@v2
38+
with:
39+
tool: cargo-llvm-cov, cargo-nextest
40+
41+
- id: pretty-test
42+
name: Install pretty-test
43+
run: cargo install cargo-pretty-test
44+
45+
- id: contract
46+
name: Run contract
47+
run: |
48+
cargo test --lib --bins
49+
cargo pretty-test --lib --bins
50+
51+
- id: summary
52+
name: Generate contract Summary
53+
run: |
54+
echo "### Living Contract! :rocket:" >> $GITHUB_STEP_SUMMARY
55+
cargo pretty-test --lib --bins --color=never >> $GITHUB_STEP_SUMMARY
56+
echo '```console' >> $GITHUB_STEP_SUMMARY
57+
echo "$OUTPUT" >> $GITHUB_STEP_SUMMARY
58+
echo '```' >> $GITHUB_STEP_SUMMARY

.github/workflows/testing.yaml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
format:
12+
name: Formatting
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- id: checkout
17+
name: Checkout Repository
18+
uses: actions/checkout@v4
19+
20+
- id: setup
21+
name: Setup Toolchain
22+
uses: dtolnay/rust-toolchain@stable
23+
with:
24+
toolchain: nightly
25+
components: rustfmt
26+
27+
- id: cache
28+
name: Enable Workflow Cache
29+
uses: Swatinem/rust-cache@v2
30+
31+
- id: format
32+
name: Run Formatting-Checks
33+
run: cargo fmt --check
34+
35+
check:
36+
name: Static Analysis
37+
runs-on: ubuntu-latest
38+
needs: format
39+
40+
strategy:
41+
matrix:
42+
toolchain: [nightly, stable]
43+
44+
steps:
45+
- id: checkout
46+
name: Checkout Repository
47+
uses: actions/checkout@v4
48+
49+
- id: setup
50+
name: Setup Toolchain
51+
uses: dtolnay/rust-toolchain@stable
52+
with:
53+
toolchain: ${{ matrix.toolchain }}
54+
components: clippy
55+
56+
- id: cache
57+
name: Enable Workflow Cache
58+
uses: Swatinem/rust-cache@v2
59+
60+
- id: tools
61+
name: Install Tools
62+
uses: taiki-e/install-action@v2
63+
with:
64+
tool: cargo-machete
65+
66+
- id: check
67+
name: Run Build Checks
68+
run: cargo check --tests --benches --examples --workspace --all-targets --all-features
69+
70+
- id: lint
71+
name: Run Lint Checks
72+
run: cargo clippy --tests --benches --examples --workspace --all-targets --all-features -- -D clippy::correctness -D clippy::suspicious -D clippy::complexity -D clippy::perf -D clippy::style -D clippy::pedantic
73+
74+
- id: docs
75+
name: Lint Documentation
76+
env:
77+
RUSTDOCFLAGS: "-D warnings"
78+
run: cargo doc --no-deps --bins --examples --workspace --all-features
79+
80+
- id: clean
81+
name: Clean Build Directory
82+
run: cargo clean
83+
84+
- id: deps
85+
name: Check Unused Dependencies
86+
run: cargo machete
87+
88+
unit:
89+
name: Units
90+
runs-on: ubuntu-latest
91+
needs: check
92+
93+
strategy:
94+
matrix:
95+
toolchain: [nightly, stable]
96+
97+
steps:
98+
- id: checkout
99+
name: Checkout Repository
100+
uses: actions/checkout@v4
101+
102+
- id: setup
103+
name: Setup Toolchain
104+
uses: dtolnay/rust-toolchain@stable
105+
with:
106+
toolchain: ${{ matrix.toolchain }}
107+
components: llvm-tools-preview
108+
109+
- id: cache
110+
name: Enable Job Cache
111+
uses: Swatinem/rust-cache@v2
112+
113+
- id: tools
114+
name: Install Tools
115+
uses: taiki-e/install-action@v2
116+
with:
117+
tool: cargo-llvm-cov, cargo-nextest
118+
119+
- id: test-docs
120+
name: Run Documentation Tests
121+
run: cargo test --doc
122+
123+
- id: test
124+
name: Run Unit Tests
125+
run: cargo test --tests --benches --examples --workspace --all-targets --all-features

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.coverage
2+
/target
3+
be2json
4+
output.json

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"streetsidesoftware.code-spell-checker",
4+
"rust-lang.rust-analyzer",
5+
"tamasfe.even-better-toml"
6+
]
7+
}

.vscode/settings.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"[rust]": {
3+
"editor.formatOnSave": true
4+
},
5+
"[ignore]": {
6+
"rust-analyzer.cargo.extraEnv": {
7+
"RUSTFLAGS": "-Z profile -C codegen-units=1 -C inline-threshold=0 -C link-dead-code -C overflow-checks=off -C panic=abort -Z panic_abort_tests",
8+
"RUSTDOCFLAGS": "-Z profile -C codegen-units=1 -C inline-threshold=0 -C link-dead-code -C overflow-checks=off -C panic=abort -Z panic_abort_tests",
9+
"CARGO_INCREMENTAL": "0",
10+
"RUST_BACKTRACE": "1"
11+
}
12+
},
13+
"rust-analyzer.checkOnSave": true,
14+
"rust-analyzer.check.command": "clippy",
15+
"rust-analyzer.check.allTargets": true,
16+
"rust-analyzer.check.extraArgs": [
17+
"--",
18+
"-D",
19+
"clippy::correctness",
20+
"-D",
21+
"clippy::suspicious",
22+
"-W",
23+
"clippy::complexity",
24+
"-W",
25+
"clippy::perf",
26+
"-W",
27+
"clippy::style",
28+
"-W",
29+
"clippy::pedantic"
30+
],
31+
"evenBetterToml.formatter.allowedBlankLines": 1,
32+
"evenBetterToml.formatter.columnWidth": 130,
33+
"evenBetterToml.formatter.trailingNewline": true,
34+
"evenBetterToml.formatter.reorderKeys": true,
35+
"evenBetterToml.formatter.reorderArrays": true,
36+
}

0 commit comments

Comments
 (0)