-
-
Notifications
You must be signed in to change notification settings - Fork 1
154 lines (144 loc) · 4.03 KB
/
rust.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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: tests
on:
pull_request:
paths-ignore:
- '**.md'
- '.github/ISSUE_TEMPLATE/**'
push:
paths-ignore:
- '**.md'
- '.github/ISSUE_TEMPLATE/**'
branches:
- main
- 1.*.x
- 0.*.x
- pr/**/ci
- ci-*
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- run: cargo clippy --all -- -D warnings
- run: cargo clippy --all --features runtime-async-std-native-tls,sqlx-mysql -- -D warnings
- run: cargo clippy --manifest-path migration/Cargo.toml -- -D warnings
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
- run: cargo fmt --all -- --check
- run: cargo fmt --manifest-path migration/Cargo.toml --all -- --check
sqlite:
name: SQLite
runs-on: ubuntu-latest
env:
DATABASE_URL: "sqlite::memory:"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo run --features sqlx-sqlite task seed_data
mysql:
name: MySQL
runs-on: ubuntu-latest
env:
DATABASE_URL: "mysql://root:@localhost/AdventureWorksLT2016"
strategy:
fail-fast: false
matrix:
version: [lts, 5.7]
services:
mysql:
image: mysql:${{ matrix.version }}
env:
MYSQL_HOST: 127.0.0.1
MYSQL_DB: mysql
MYSQL_USER: sea
MYSQL_PASSWORD: sea
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- "3306:3306"
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: mysql -uroot -h 127.0.0.1 mysql -e 'CREATE DATABASE `AdventureWorksLT2016`'
- run: cargo run --features sqlx-mysql task seed_data
mariadb:
name: MariaDB
runs-on: ubuntu-latest
env:
DATABASE_URL: "mysql://root:@localhost/AdventureWorksLT2016"
strategy:
fail-fast: false
matrix:
version: [lts]
services:
mariadb:
image: mariadb:${{ matrix.version }}
env:
MARIADB_HOST: 127.0.0.1
MARIADB_DB: mysql
MARIADB_USER: sea
MARIADB_PASSWORD: sea
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes
ports:
- "3306:3306"
options: >-
--health-cmd="healthcheck.sh
--connect
--innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: mysql -uroot -h 127.0.0.1 mysql -e 'CREATE DATABASE `AdventureWorksLT2016`'
- run: cargo run --features sqlx-mysql task seed_data
postgres:
name: Postgres
runs-on: ubuntu-latest
env:
DATABASE_URL: "postgres://root:root@localhost/AdventureWorksLT2016"
strategy:
fail-fast: false
matrix:
version: [14, 16]
services:
postgres:
image: postgres:${{ matrix.version }}
env:
POSTGRES_HOST: 127.0.0.1
POSTGRES_USER: root
POSTGRES_PASSWORD: root
ports:
- "5432:5432"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: psql -q postgres://root:root@localhost/postgres -c 'CREATE DATABASE "AdventureWorksLT2016"'
- run: cargo run --features sqlx-postgres task seed_data