mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-30 05:11:13 +00:00
* Fix breakage from Rustup 1.28 <https://blog.rust-lang.org/2025/03/02/Rustup-1.28.0.html> * Let `Swatinem/rust-cache` generate cache keys
103 lines
2.5 KiB
YAML
103 lines
2.5 KiB
YAML
name: SQLx CLI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
- "*-dev"
|
|
|
|
jobs:
|
|
check:
|
|
name: Check
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Rust
|
|
run: |
|
|
rustup show active-toolchain || rustup toolchain install
|
|
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
|
|
|
|
- name: Setup Rust
|
|
run: rustup show active-toolchain || rustup toolchain install
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- 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: Setup Rust
|
|
run: |
|
|
rustup show active-toolchain || rustup toolchain install
|
|
rustup override set stable
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- 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 }}
|