Skip to content

Commit c912bab

Browse files
authored
added basic CI (#17)
1 parent 702a251 commit c912bab

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
merge_group:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
DATABASE_URL: postgres://postgres:postgres@localhost:5436/test
12+
13+
jobs:
14+
ci:
15+
runs-on: ubuntu-latest
16+
17+
services:
18+
postgres:
19+
image: postgres:14-alpine
20+
env:
21+
POSTGRES_DB: test
22+
POSTGRES_USER: postgres
23+
POSTGRES_PASSWORD: postgres
24+
ports:
25+
- 5436:5432
26+
options: >-
27+
--health-cmd "pg_isready -U postgres -d test"
28+
--health-interval 10s
29+
--health-timeout 5s
30+
--health-retries 5
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Install Rust toolchain
36+
uses: dtolnay/rust-toolchain@stable
37+
with:
38+
components: rustfmt, clippy
39+
40+
- name: Check formatting
41+
run: cargo fmt --check
42+
43+
- name: Run Clippy
44+
run: cargo clippy --all-targets --all-features -- -D warnings
45+
46+
- name: Run tests
47+
run: cargo test

0 commit comments

Comments
 (0)