Skip to content

Various metrics on connections to upstream time sources #1097

Various metrics on connections to upstream time sources

Various metrics on connections to upstream time sources #1097

Workflow file for this run

name: checks
permissions:
contents: read
on:
push:
branches:
- 'release/**'
pull_request:
branches-ignore:
- 'release/**'
schedule:
- cron: '0 4 * * *'
merge_group:
types: [checks_requested]
workflow_call: {}
jobs:
build:
name: Build and test
runs-on: "${{ matrix.os }}"
env:
SQLX_OFFLINE: "true"
strategy:
matrix:
include:
- rust: stable
os: ubuntu-latest
target: "x86_64-unknown-linux-gnu"
- rust: beta
os: ubuntu-latest
target: "x86_64-unknown-linux-gnu"
- rust: "msrv"
os: ubuntu-latest
target: "x86_64-unknown-linux-gnu"
- rust: "stable"
os: ubuntu-latest
target: "x86_64-unknown-linux-musl"
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Set target rust version
run: echo "TARGET_RUST_VERSION=$(if [ "${{matrix.rust}}" = "msrv" ]; then grep rust-version Cargo.toml | grep MSRV | cut -d'"' -f2; else echo "${{matrix.rust}}"; fi)" >> $GITHUB_ENV
- name: Install nightly toolchain for direct-minimal-versions
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: nightly-2025-08-11
targets: "${{ matrix.target }}"
if: ${{ matrix.rust == 'msrv' }}
- name: Install toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: "${TARGET_RUST_VERSION}"
targets: "${{ matrix.target }}"
- name: Downgrade direct dependencies to minimal versions
run: cargo +nightly-2025-08-11 update -Z direct-minimal-versions
if: ${{ matrix.rust == 'msrv' }}
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@d30d20f04a3b09718e138524795d0d6ab7703dcb
with:
target: ${{ matrix.target }}
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@887bc4e03483810873d617344dd5189cd82e7b8b
with:
tool: cargo-llvm-cov
- name: Rust cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5
with:
shared-key: "${{matrix.rust}}-${{matrix.target}}"
- name: cargo build
run: cargo build
- name: cargo test
run: cargo llvm-cov --target ${{matrix.target}} --lcov --output-path lcov.info
env:
RUST_BACKTRACE: 1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
flags: test, ${{ matrix.target }}, ${{ matrix.rust }}
fail_ci_if_error: false
unused:
name: Check unused dependencies
env:
SQLX_OFFLINE: "true"
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: nightly-2025-08-11
- name: Install udeps
uses: taiki-e/install-action@887bc4e03483810873d617344dd5189cd82e7b8b
with:
tool: cargo-udeps
- name: cargo udeps
run: cargo udeps --workspace --all-targets
format:
name: Format
env:
SQLX_OFFLINE: "true"
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: stable
components: rustfmt
- name: Check formatting
run: cargo fmt --all --check
clippy:
name: Clippy
env:
SQLX_OFFLINE: "true"
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
runs_on: ubuntu-latest
- target: armv7-unknown-linux-gnueabihf
runs_on: ubuntu-latest
- target: x86_64-unknown-linux-musl
runs_on: ubuntu-latest
- target: aarch64-apple-darwin
runs_on: macos-latest
runs-on: ${{matrix.runs_on}}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: stable
components: clippy
targets: ${{matrix.target}}
- name: Setup tools for cross compilation
uses: awalsh128/cache-apt-pkgs-action@acb598e5ddbc6f68a970c5da0688d2f3a9f04d05 # v1.6.0
with:
packages: musl-tools qemu-user-static crossbuild-essential-armhf crossbuild-essential-arm64 crossbuild-essential-i386
version: 1
if: ${{matrix.runs_on == 'ubuntu-latest'}}
- name: Install bindgen-cli
uses: taiki-e/install-action@887bc4e03483810873d617344dd5189cd82e7b8b
with:
tool: bindgen-cli
if: ${{matrix.runs_on == 'ubuntu-latest'}}
- name: Rust cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5
with:
shared-key: "stable-${{matrix.target}}"
- name: Run clippy
run: cargo clippy --target ${{matrix.target}} --all-targets -- -D warnings
audit-dependencies:
name: Audit dependencies
env:
SQLX_OFFLINE: "true"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979
with:
arguments: --workspace --all-features
fuzz-code-coverage:
name: Fuzz with code coverage
env:
SQLX_OFFLINE: "true"
runs-on: ubuntu-latest
strategy:
matrix:
include:
- fuzz_target: client_request
corpus: ""
features: ''
- fuzz_target: key_exchange_response
corpus: ""
features: ''
- fuzz_target: record
corpus: ""
features: ''
- fuzz_target: server_information_response
corpus: ""
features: ''
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: nightly-2025-08-11
components: llvm-tools-preview
- name: Install cargo fuzz & rustfilt
uses: taiki-e/install-action@887bc4e03483810873d617344dd5189cd82e7b8b
with:
tool: cargo-fuzz,rustfilt
- name: Run `cargo fuzz`
env:
RUST_BACKTRACE: "1"
# prevents `cargo fuzz coverage` from rebuilding everything
RUSTFLAGS: "-C instrument-coverage"
run: |
cargo fuzz run --target $(rustc --print host-tuple) ${{matrix.features}} ${{matrix.fuzz_target}} ${{matrix.corpus}} -- -max_total_time=10
- name: Fuzz codecov
run: |
cargo fuzz coverage --target $(rustc --print host-tuple) ${{matrix.features}} ${{matrix.fuzz_target}} ${{matrix.corpus}}
$(rustc --print sysroot)/lib/rustlib/$(rustc --print host-tuple)/bin/llvm-cov export -Xdemangler=rustfilt \
target/x86_64-unknown-linux-musl/coverage/$(rustc --print host-tuple)/release/${{matrix.fuzz_target}} \
-instr-profile=fuzz/coverage/${{matrix.fuzz_target}}/coverage.profdata \
--format=lcov \
-ignore-filename-regex="\.cargo|\.rustup" > lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
with:
files: ./lcov.info
fail_ci_if_error: false
flags: fuzz, fuzz-${{ matrix.fuzz_target }}
token: ${{ secrets.CODECOV_TOKEN }}
name: fuzz