Skip to content

Commit f7f6a78

Browse files
committed
Initial commit
0 parents  commit f7f6a78

17 files changed

+600
-0
lines changed

.devcontainer/devcontainer.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "rust-template",
3+
"dockerComposeFile": "docker-compose.yml",
4+
"service": "devcontainer",
5+
"workspaceFolder": "/workspace",
6+
"shutdownAction": "stopCompose",
7+
"customizations": {
8+
"vscode": {
9+
"settings": {},
10+
"extensions": [
11+
"dustypomerleau.rust-syntax",
12+
"eamodio.gitlens",
13+
"esbenp.prettier-vscode",
14+
"github.vscode-github-actions",
15+
"GitHub.vscode-pull-request-github",
16+
"njpwerner.autodocstring",
17+
"oderwat.indent-rainbow",
18+
"rust-lang.rust-analyzer",
19+
"serayuzgur.crates",
20+
"SonarSource.sonarlint-vscode",
21+
"streetsidesoftware.code-spell-checker-german",
22+
"streetsidesoftware.code-spell-checker",
23+
"tamasfe.even-better-toml"
24+
]
25+
}
26+
},
27+
"postCreateCommand": ".devcontainer/postCreateCommand.sh"
28+
}

.devcontainer/docker-compose.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
devcontainer:
3+
image: mcr.microsoft.com/devcontainers/rust:1-1-bullseye
4+
command: sleep infinity
5+
volumes:
6+
- ..:/workspace:cached
7+
ports:
8+
# for CodeGPT vscode plugin
9+
- "54112:54112"

.devcontainer/postCreateCommand.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
sudo apt update
4+
sudo apt upgrade -y
5+
rustup component add clippy

.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
tab_width = 4
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
[*.rs]
15+
# Rust-specific settings
16+
indent_style = space
17+
indent_size = 4

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
*.{cmd,[cC][mM][dD]} text eol=crlf
3+
*.{bat,[bB][aA][tT]} text eol=crlf

.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# For more details, see https://containers.dev/guide/dependabot
2+
version: 2
3+
updates:
4+
- package-ecosystem: "devcontainers"
5+
directory: "/"
6+
schedule:
7+
interval: weekly
8+
- package-ecosystem: "cargo"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

.github/workflows/on-pr.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- "releases/*"
8+
9+
# Cancel in-progress workflow runs if a newer run for the same PR is triggered
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
code-quality:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: true
19+
20+
steps:
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: "22"
25+
26+
- name: Install commitlint and conventional config
27+
run: |
28+
npm install -g @commitlint/cli @commitlint/config-conventional
29+
30+
- name: Commitlint check for commits
31+
run: |
32+
git fetch origin main
33+
git log origin/main..HEAD --pretty=format:%H | xargs -I {} sh -c 'git show --quiet --format=%B {} | commitlint'
34+
35+
- name: Format check
36+
run: cargo fmt -- --check
37+
38+
- name: Install cspell
39+
run: |
40+
npm install -g [email protected]
41+
npm install -g cspell-dict-de
42+
43+
- name: Run cspell
44+
run: cspell "**/*" --config cspell.json --quiet
45+
46+
build:
47+
name: Build and Test
48+
runs-on: ubuntu-latest
49+
strategy:
50+
fail-fast: true
51+
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v3
55+
56+
- name: Set up Rust
57+
uses: actions/setup-rust@v1
58+
with:
59+
rust-version: stable
60+
61+
- name: Run Clippy
62+
run: cargo clippy -- -D warnings
63+
64+
- name: Cache Cargo registry
65+
uses: actions/cache@v3
66+
with:
67+
path: |
68+
~/.cargo/registry
69+
~/.cargo/git
70+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
71+
restore-keys: |
72+
${{ runner.os }}-cargo-
73+
74+
- name: Build
75+
run: cargo build --release
76+
77+
- name: Run tests
78+
run: cargo test --verbose

0 commit comments

Comments
 (0)