-
Notifications
You must be signed in to change notification settings - Fork 1.3k
100 lines (81 loc) · 2.4 KB
/
sqlx-cli.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
name: SQLx CLI
on:
pull_request:
push:
branches:
- main
- "*-dev"
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
rustup update
rustup component add clippy
rustup toolchain install beta
rustup component add --toolchain beta clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --manifest-path sqlx-cli/Cargo.toml -- -D warnings
# Run beta for new warnings but don't break the build.
# Use a subdirectory of `target` to avoid clobbering the cache.
- run: >
cargo +beta clippy
--manifest-path sqlx-cli/Cargo.toml
--target-dir target/beta/
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Note: macOS-latest uses M1 Silicon (ARM64)
os:
- ubuntu-latest
# FIXME: migrations tests fail on Windows for whatever reason
# - windows-latest
- macOS-13
- macOS-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-test
- run: cargo test --manifest-path sqlx-cli/Cargo.toml
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Note: macOS-latest uses M1 Silicon (ARM64)
os:
- ubuntu-latest
- windows-latest
- macOS-13
- macOS-latest
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
args: --features openssl-vendored
bin: target/debug/cargo-sqlx
- os: windows-latest
target: x86_64-pc-windows-msvc
bin: target/debug/cargo-sqlx.exe
- os: macOS-13
target: x86_64-apple-darwin
bin: target/debug/cargo-sqlx
- os: macOS-latest
target: aarch64-apple-darwin
bin: target/debug/cargo-sqlx
steps:
- uses: actions/checkout@v4
- name: Use latest Rust
run: rustup override set stable
- uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-cli
- run: cargo build --manifest-path sqlx-cli/Cargo.toml --bin cargo-sqlx ${{ matrix.args }}
- uses: actions/upload-artifact@v4
with:
name: cargo-sqlx-${{ matrix.target }}
path: ${{ matrix.bin }}