Skip to content

Commit 448259d

Browse files
authored
Merge pull request #2 from bordeux/feature/pre-initial-release
feat: initial implementation of tmpltool with complete CI/CD pipeline
2 parents 39c7c5f + bcf5eda commit 448259d

55 files changed

Lines changed: 4620 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.commitlintrc.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"],
3+
"rules": {
4+
"type-enum": [
5+
2,
6+
"always",
7+
[
8+
"feat",
9+
"fix",
10+
"docs",
11+
"style",
12+
"refactor",
13+
"perf",
14+
"test",
15+
"build",
16+
"ci",
17+
"chore",
18+
"revert"
19+
]
20+
],
21+
"type-case": [2, "always", "lower-case"],
22+
"type-empty": [2, "never"],
23+
"subject-empty": [2, "never"],
24+
"subject-case": [0],
25+
"header-max-length": [2, "always", 100]
26+
}
27+
}

.dockerignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Git
2+
.git
3+
.gitignore
4+
.gitattributes
5+
6+
# CI/CD
7+
.github
8+
9+
# Build artifacts
10+
target/
11+
*.tar.gz
12+
*.zip
13+
14+
# IDE
15+
.vscode/
16+
.idea/
17+
*.swp
18+
*.swo
19+
*.swn
20+
.DS_Store
21+
22+
# Documentation
23+
README.md
24+
CHANGELOG.md
25+
CONTRIBUTING.md
26+
LICENSE
27+
*.md
28+
29+
# Release config
30+
.releaserc.json
31+
32+
# Cargo
33+
Cargo.lock
34+
35+
# Editor config
36+
.editorconfig
37+
38+
# Makefile
39+
Makefile.toml

.editorconfig

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# EditorConfig helps maintain consistent coding styles across different editors and IDEs
2+
# See https://editorconfig.org for more information
3+
4+
# Top-most EditorConfig file
5+
root = true
6+
7+
# Default settings for all files
8+
[*]
9+
charset = utf-8
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
# Rust source files
15+
[*.rs]
16+
indent_style = space
17+
indent_size = 4
18+
max_line_length = 100
19+
20+
# TOML files (Cargo.toml, Cargo.lock, etc.)
21+
[*.toml]
22+
indent_style = space
23+
indent_size = 2
24+
25+
# Markdown files
26+
[*.md]
27+
indent_style = space
28+
indent_size = 2
29+
trim_trailing_whitespace = false
30+
max_line_length = off
31+
32+
# YAML files
33+
[*.{yml,yaml}]
34+
indent_style = space
35+
indent_size = 2
36+
37+
# JSON files
38+
[*.json]
39+
indent_style = space
40+
indent_size = 2
41+
42+
# Shell scripts
43+
[*.sh]
44+
indent_style = space
45+
indent_size = 2
46+
end_of_line = lf
47+
48+
# Makefiles
49+
[Makefile]
50+
indent_style = tab
51+
indent_size = 4
52+
53+
# Git config
54+
[.gitconfig]
55+
indent_style = tab
56+
57+
# Ignore files
58+
[.gitignore]
59+
indent_style = space
60+
indent_size = 2

.github/workflows/ci.yml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
pull_request:
9+
branches:
10+
- master
11+
- main
12+
13+
env:
14+
CARGO_TERM_COLOR: always
15+
16+
jobs:
17+
format:
18+
name: Format Check
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Rust
25+
uses: dtolnay/rust-toolchain@stable
26+
with:
27+
components: rustfmt
28+
29+
- name: Check formatting
30+
run: cargo fmt --all -- --check
31+
32+
clippy:
33+
name: Clippy Lints
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
39+
- name: Setup Rust
40+
uses: dtolnay/rust-toolchain@stable
41+
with:
42+
components: clippy
43+
44+
- name: Cache cargo registry
45+
uses: actions/cache@v4
46+
with:
47+
path: ~/.cargo/registry
48+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
49+
50+
- name: Cache cargo index
51+
uses: actions/cache@v4
52+
with:
53+
path: ~/.cargo/git
54+
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
55+
56+
- name: Cache cargo build
57+
uses: actions/cache@v4
58+
with:
59+
path: target
60+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
61+
62+
- name: Run clippy
63+
run: cargo clippy --all-targets --all-features -- -D warnings
64+
65+
test:
66+
name: Test Suite
67+
runs-on: ${{ matrix.os }}
68+
strategy:
69+
matrix:
70+
os: [ubuntu-latest, macos-latest, windows-latest]
71+
rust: [stable]
72+
steps:
73+
- name: Checkout code
74+
uses: actions/checkout@v4
75+
76+
- name: Setup Rust
77+
uses: dtolnay/rust-toolchain@master
78+
with:
79+
toolchain: ${{ matrix.rust }}
80+
81+
- name: Cache cargo registry
82+
uses: actions/cache@v4
83+
with:
84+
path: ~/.cargo/registry
85+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
86+
87+
- name: Cache cargo index
88+
uses: actions/cache@v4
89+
with:
90+
path: ~/.cargo/git
91+
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
92+
93+
- name: Cache cargo build
94+
uses: actions/cache@v4
95+
with:
96+
path: target
97+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
98+
99+
- name: Run tests
100+
run: cargo test --verbose
101+
102+
coverage:
103+
name: Code Coverage
104+
runs-on: ubuntu-latest
105+
steps:
106+
- name: Checkout code
107+
uses: actions/checkout@v4
108+
109+
- name: Setup Rust
110+
uses: dtolnay/rust-toolchain@stable
111+
112+
- name: Install tarpaulin
113+
run: cargo install cargo-tarpaulin
114+
115+
- name: Generate coverage
116+
run: cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml
117+
118+
- name: Upload coverage to Codecov
119+
uses: codecov/codecov-action@v4
120+
with:
121+
files: ./cobertura.xml
122+
fail_ci_if_error: false
123+
token: ${{ secrets.CODECOV_TOKEN }}
124+
125+
cargo-make:
126+
name: Cargo Make QA
127+
runs-on: ubuntu-latest
128+
steps:
129+
- name: Checkout code
130+
uses: actions/checkout@v4
131+
132+
- name: Setup Rust
133+
uses: dtolnay/rust-toolchain@stable
134+
with:
135+
components: rustfmt, clippy
136+
137+
- name: Install cargo-make
138+
run: cargo install --force cargo-make
139+
140+
- name: Cache cargo registry
141+
uses: actions/cache@v4
142+
with:
143+
path: ~/.cargo/registry
144+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
145+
146+
- name: Cache cargo index
147+
uses: actions/cache@v4
148+
with:
149+
path: ~/.cargo/git
150+
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
151+
152+
- name: Cache cargo build
153+
uses: actions/cache@v4
154+
with:
155+
path: target
156+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
157+
158+
- name: Run QA checks
159+
run: cargo make ci
160+
161+
- name: Test examples
162+
run: cargo make test-examples

0 commit comments

Comments
 (0)