-
-
Notifications
You must be signed in to change notification settings - Fork 8
163 lines (146 loc) · 3.86 KB
/
test.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
155
156
157
158
159
160
161
162
163
name: Test
on:
workflow_call: { }
push:
branches:
- master
paths-ignore:
- .github/CODE_OF_CONDUCT.md
- .github/CODEOWNERS
- .github/dependabot.yml
- .github/FUNDING.yml
- .github/workflows/release.yml
- LICENSE
- .gitignore
pull_request:
paths-ignore:
- .github/CODE_OF_CONDUCT.md
- .github/CODEOWNERS
- .github/dependabot.yml
- .github/FUNDING.yml
- .github/workflows/release.yml
- LICENSE
- .gitignore
permissions:
contents: read
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: --deny warnings
jobs:
doc:
name: Doc build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Init toolchain
uses: alorel-actions/cargo/init@v1
id: toolchain
with:
toolchain: nightly-2024-10-18
cache-prefix: doc
local: true
- name: Doc
run: cargo doc --workspace --all-features --no-deps
env:
RUSTDOCFLAGS: --cfg doc_cfg --deny warnings
- name: Cleanup
run: rm -rf target/doc
doctest:
name: Doc test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Init toolchain
uses: alorel-actions/cargo/init@v1
id: toolchain
with:
cache-prefix: doctest
local: true
- name: Test
run: cargo test --workspace --doc --future-incompat-report --all-features
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Init toolchain
uses: alorel-actions/cargo/init@v1
id: toolchain
with:
components: rustfmt,clippy
cache-prefix: lint
local: true
- name: Fmt
run: cargo fmt --check
- name: Clippy
run: cargo clippy --workspace --tests --all-features --locked --no-deps
environment:
name: Environment test for ${{ matrix.toolchain }} on ${{ matrix.os }}
uses: ./.github/workflows/unit-test.yml
with:
toolchain: ${{ matrix.toolchain }}
os: ${{ matrix.os }}
flags: --all-features
strategy:
fail-fast: false
matrix:
include:
- toolchain: nightly-2024-10-18
os: ubuntu-latest
- toolchain: 1.75.0
os: ubuntu-latest
- toolchain: stable
os: ubuntu-latest
- toolchain: stable
os: macos-latest
feature:
name: Feature test for ${{ matrix.flags || 'no flags' }}
uses: ./.github/workflows/unit-test.yml
with:
flags: ${{ matrix.flags }}
strategy:
fail-fast: false
matrix:
flags:
- ''
- --features cursors
- --features dates
- --features indices
- --features list-databases
- --features serde
- --features "cursors streams"
- --features switch
- --features typed-arrays
- --features "typed-arrays serde"
- --features "cursors streams serde"
- --features "indices serde"
- --features "indices cursors"
- --features "indices cursors serde"
- --features "indices cursors streams"
- --features "indices cursors streams serde"
- --features "dates serde"
- --features "cursors serde"
- --features "async-upgrade"
- --features "tx-done"
- --features "async-upgrade tx-done"
done:
name: All tests
runs-on: ubuntu-latest
needs:
- doc
- lint
- feature
- doctest
- environment
steps:
- uses: actions/checkout@v4
name: Checkout
with:
fetch-depth: 0
fetch-tags: true
- name: Generate changelog
id: changelog
uses: ./.github/actions/changelog