-
Notifications
You must be signed in to change notification settings - Fork 26
101 lines (85 loc) · 2.18 KB
/
ci.yaml
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
name: CI
on:
pull_request:
push:
branches:
- main
env:
RUSTFLAGS: -Dwarnings
POSTGRES_DB: async_sqlx_session_tests
PG_TEST_DB_URL: postgres://postgres:postgres@localhost/async_sqlx_session_tests
MYSQL_DB: async_sqlx_session_tests
MYSQL_TEST_DB_URL: mysql://root:root@localhost/async_sqlx_session_tests
jobs:
build_and_test:
name: Build and test
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, nightly]
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: async_sqlx_session_tests
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
mysql:
image: mysql
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: async_sqlx_session_tests
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 3
steps:
- uses: actions/checkout@main
- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: pg tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all --features pg -- --test-threads=1
- name: sqlite tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all --features sqlite
- name: mysql tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all --features mysql -- --test-threads=1
check_fmt_and_docs:
name: Checking fmt, clippy, and docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: setup
run: |
rustup component add clippy rustfmt
rustc --version
- name: clippy
run: cargo clippy -- -D warnings
- name: fmt
run: cargo fmt --all -- --check
- name: Docs
run: cargo doc --no-deps