Skip to content

Commit 63f293a

Browse files
committed
base
Signed-off-by: Pushkar Mishra <[email protected]>
1 parent 597fe13 commit 63f293a

22 files changed

+4277
-4
lines changed

.env.example

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
DATABASE_URL=sqlite:url_shortener.db
2+
SERVER_HOST=127.0.0.1
3+
SERVER_PORT=8080
4+
SHORT_URL_LENGTH=6
5+
LOG_LEVEL=info
6+
ENABLE_METRICS=false

.github/workflows/rust.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Rust CI
2+
3+
on:
4+
push:
5+
branches: [dev]
6+
pull_request:
7+
branches: [dev]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: dtolnay/rust-toolchain@stable
19+
- uses: Swatinem/rust-cache@v2
20+
- name: Run tests
21+
run: cargo test
22+
23+
fmt:
24+
name: Format
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v3
28+
- uses: dtolnay/rust-toolchain@stable
29+
with:
30+
components: rustfmt
31+
- name: Check formatting
32+
run: cargo fmt --all -- --check
33+
34+
clippy:
35+
name: Clippy
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v3
39+
- uses: dtolnay/rust-toolchain@stable
40+
with:
41+
components: clippy
42+
- uses: Swatinem/rust-cache@v2
43+
- name: Check lints
44+
run: cargo clippy -- -D warnings

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
/target
2+
**/*.rs.bk
3+
Cargo.lock
4+
*.db
5+
.env

0 commit comments

Comments
 (0)