-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (56 loc) · 1.46 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Numtracker CI
on:
push:
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Check formatting
# Use nightly for formatting to enable unstable formatting styles
# * group imports
# * import_granularity
run: cargo +nightly fmt -- --check
- name: Clippy
run: |
cargo --version
cargo clippy --version
cargo clippy --all-targets --all-features -- --deny warnings
sqlx_offline:
name: Check prepared offline query data
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: Install sqlx CLI
run: cargo install sqlx-cli@0.8.2
- name: Check Prepared Queries
run: |
touch numtracker.db
cargo sqlx migrate run
cargo sqlx prepare --check
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: Build Everything
run: cargo build --all-targets
- name: Run tests
run: cargo test --all-targets --verbose