Repository navigation
127 lines (114 loc) · 5.08 KB
/
Copy pathci.yml
File metadata and controls
127 lines (114 loc) · 5.08 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
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 rust tooling
run: |
rustup update ${{ matrix.toolchain }}
rustup component add --toolchain ${{ matrix.toolchain }} clippy rustfmt
- name: Print rust tooling information
run: |
rustup run ${{ matrix.toolchain }} rustc --version
rustup run ${{ matrix.toolchain }} cargo --version --verbose
rustup run ${{ matrix.toolchain }} cargo clippy --version
rustup run ${{ matrix.toolchain }} cargo fmt --version
- name: Install native database libraries
run: |
sudo apt-get update
sudo apt-get install -y libpq-dev default-libmysqlclient-dev
- 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: rustup run ${{ matrix.toolchain }} cargo fmt --all -- --check
- name: Test database, driver, runtime, and TLS configurations
run: python3 scripts/test-databases.py --postgres 14 --mysql 8.4 --toolchain "${{ matrix.toolchain }}" --full
- name: Run doc tests
run: |
for driver in sqlx diesel; do
for runtime in runtime-async-std runtime-tokio; do
rustup run ${{ matrix.toolchain }} cargo test --features "sqlite,$driver,$runtime,macros" --doc --verbose
done
done
- name: Check workspace examples
run: |
for package in mysql-diesel mysql-sqlx postgres-diesel postgres-sqlx sqlite-sqlx; do
rustup run ${{ matrix.toolchain }} cargo check -p "$package" --all-targets
done
- name: Run clippy
run: |
rustup run ${{ matrix.toolchain }} cargo clippy --features sqlite,sqlx,runtime-async-std,macros --all-targets -- -Dwarnings
rustup run ${{ matrix.toolchain }} cargo clippy --features postgres,sqlx,runtime-async-std,macros --all-targets -- -Dwarnings
rustup run ${{ matrix.toolchain }} cargo clippy --features mysql,sqlx,runtime-async-std,macros --all-targets -- -Dwarnings
rustup run ${{ matrix.toolchain }} cargo clippy --features sqlite,diesel --all-targets -- -Dwarnings
rustup run ${{ matrix.toolchain }} cargo clippy --features postgres,diesel --all-targets -- -Dwarnings
rustup run ${{ matrix.toolchain }} cargo clippy --features mysql,diesel --all-targets -- -Dwarnings
rustup run ${{ matrix.toolchain }} cargo clippy --features sqlite,diesel,runtime-async-std,macros --all-targets -- -Dwarnings
rustup run ${{ matrix.toolchain }} cargo clippy --features postgres,diesel,runtime-async-std,macros --all-targets -- -Dwarnings
rustup run ${{ matrix.toolchain }} cargo clippy --features mysql,diesel,runtime-async-std,macros --all-targets -- -Dwarnings
for database in sqlite mysql postgres; do
rustup run ${{ matrix.toolchain }} cargo clippy --features "$database,sqlx,runtime-tokio,macros" --all-targets -- -Dwarnings
rustup run ${{ matrix.toolchain }} cargo clippy --features "$database,diesel,runtime-tokio,macros" --all-targets -- -Dwarnings
rustup run ${{ matrix.toolchain }} cargo clippy --no-default-features --features "$database,sqlx,runtime-tokio,macros,rustls" --all-targets -- -Dwarnings
done
rustup run ${{ matrix.toolchain }} cargo clippy --features sqlite,sqlx,runtime-tokio,runtime-async-std,macros --all-targets -- -Dwarnings
rustup run ${{ matrix.toolchain }} cargo clippy --features sqlite,diesel,runtime-tokio,runtime-async-std,macros --all-targets -- -Dwarnings
database-compatibility:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- database: postgres
version: '14'
- database: postgres
version: '15'
- database: postgres
version: '16'
- database: postgres
version: '17'
- database: postgres
version: '18'
- database: mysql
version: '8.4'
- database: mysql
version: '9.7'
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- name: Install native database libraries
run: |
sudo apt-get update
sudo apt-get install -y libpq-dev default-libmysqlclient-dev
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: rust_stable-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Test matching database and dump client versions
run: python3 scripts/test-databases.py --${{ matrix.database }} "${{ matrix.version }}"