-
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (62 loc) · 2.17 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: '*'
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.nightly }}
strategy:
fail-fast: false
matrix:
toolchain: [ 'stable' ]
nightly: [false]
include:
- toolchain: 'nightly'
nightly: true
steps:
- uses: actions/checkout@v3
- name: Install toolchain
run: |
rustup update ${{ matrix.toolchain }}
rustup component add clippy rustfmt
- name: Print rust tooling information
run: |
rustc --version
cargo --version --verbose
cargo clippy --version
cargo fmt --version
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: rust_${{ matrix.toolchain }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run test - sqlite | sqlx | runtime-async-std | macros
run: cargo test --features sqlite,sqlx,runtime-async-std,macros --all-targets --verbose
- name: Run test - sqlite | diesel | runtime-async-std | macros
run: cargo test --features sqlite,diesel,runtime-async-std,macros --all-targets --verbose
- name: Run test - sqlite | diesel
run: cargo test --features sqlite,diesel --all-targets --verbose
- name: Start containers for database tests
run: docker compose -f "docker-compose.yml" up -d
- name: Run test - mysql | diesel
run: cargo test --features mysql,diesel --all-targets --verbose
- name: Run test - mysql | sqlx | runtime-async-std
run: cargo test --features mysql,sqlx,runtime-async-std --all-targets --verbose
- name: Stop containers for database tests
if: always()
run: |
docker compose -f "docker-compose.yml" down --volumes
sudo rm -rf .data/{postgresql-15,mysql-8}
- name: Run doc tests
run: cargo test --features sqlite,sqlx,runtime-async-std,macros --doc --verbose
- name: Run clippy
run: cargo clippy --features sqlite,sqlx,runtime-async-std,macros