-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (82 loc) · 3.08 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CI
on:
pull_request:
push:
branches:
- main
env:
DATABASE_URL: "postgres://postgres:postgres@localhost/crdb-test"
jobs:
just-test:
strategy:
matrix:
hardcoded:
- false
test:
- { name: Build, command: build --no-dev-deps }
- { name: Clippy, command: clippy --no-dev-deps, extra: -- -D warnings }
- { name: Test, command: nextest run --no-tests=pass }
rust:
- { name: Nightly }
- { name: Stable, sigil: '+stable', toolchain: 'stable' }
- { name: MSRV, sigil: '+1.81.0', toolchain: '1.81.0' }
include:
- hardcoded: true
name: Just Test
command: just test
name: ${{ matrix.hardcoded && matrix.name || format('{0} All Features ({1})', matrix.test.name, matrix.rust.name) }}
runs-on: ubuntu-latest
steps:
# Checkout the repository
- uses: actions/checkout@v4
# Install cargo dependencies
- uses: taiki-e/install-action@510b3ecd7915856b6909305605afa7a8a57c1b04
with:
tool: just, cargo-nextest, cargo-hack, sqlx-cli, wasm-bindgen-cli
# Setup sccache, that'll share build artifacts with all the target directories
- uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9
- run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
# Setup chromedriver for client-js tests
- uses: nanasess/setup-chromedriver@e93e57b843c0c92788f22483f1a31af8ee48db25
- run: sudo Xvfb -ac :0 -screen 0 1280x1024x24 > /dev/null 2>&1 &
# Setup postgresql for server tests
- uses: ikalnytskyi/action-setup-postgres@10ab8a56cc77b4823c2bfa57b1d4dd5605ef0481
with:
username: postgres
password: postgres
database: crdb-test
- run: sqlx migrate run --source crdb-postgres/migrations
# Prepare rustup
- run: ${{ matrix.rust.toolchain && format('rustup toolchain install {0}', matrix.rust.toolchain) }}
- run: ${{ matrix.rust.toolchain && format('rustup component add clippy --toolchain {0}', matrix.rust.toolchain) }}
# Run the tests
- run: ${{ matrix.hardcoded && matrix.command || format('cargo {0} hack {1} --workspace --feature-powerset {2}', matrix.rust.sigil, matrix.test.command, matrix.test.extra) }}
just-clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@510b3ecd7915856b6909305605afa7a8a57c1b04
with:
tool: just
- run: just clippy
just-udeps:
name: Udeps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@510b3ecd7915856b6909305605afa7a8a57c1b04
with:
tool: just, cargo-hack, cargo-udeps
- run: just udeps-full
just-doc:
name: Doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@510b3ecd7915856b6909305605afa7a8a57c1b04
with:
tool: just
- run: just doc