Implement get_current_tid_inner
for Android
#1103
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
- 'LICENSE' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- 'LICENSE' | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
# When updating this, also update: | |
# - src/lib.rs | |
# - Cargo.toml | |
# - README.md | |
rust_minver: 1.60.0 | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
format: | |
strategy: | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Disable bench dependencies | |
run: ./.github/workflows/disable-bench-deps.sh | |
- name: Install Rust nightly | |
run: | | |
rustup toolchain install nightly | |
rustup component add rustfmt --toolchain nightly | |
- name: Restore cargo caches | |
uses: Swatinem/rust-cache@v2 | |
- name: Check formatting | |
run: cargo +nightly fmt --all --verbose -- --check | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-latest', 'windows-latest', 'macos-latest'] | |
fn_features: ['', 'log native libsystemd multi-thread runtime-pattern serde_json'] | |
cfg_feature: ['', 'flexible-string', 'source-location'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set a non-UTC timezone # for detecting issues related to the local timezone | |
uses: szenius/set-timezone@v2.0 | |
with: | |
timezoneLinux: "Asia/Shanghai" | |
timezoneMacos: "Asia/Shanghai" | |
timezoneWindows: "China Standard Time" | |
- name: Disable bench dependencies | |
run: ./.github/workflows/disable-bench-deps.sh | |
- name: Install dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo bash ./.github/workflows/install-deps.sh | |
- name: Restore cargo caches | |
uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --features "${{ matrix.fn_features }} ${{ matrix.cfg_feature }}" --verbose | |
- name: Run examples | |
if: matrix.fn_features != '' | |
run: | | |
for example in `ls spdlog/examples/*.rs | xargs basename --suffix=.rs`; do | |
cargo run --features "${{ matrix.fn_features }} ${{ matrix.cfg_feature }}" --example ${example}; | |
done | |
clippy: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-latest', 'windows-latest', 'macos-latest'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo bash ./.github/workflows/install-deps.sh | |
- name: Install Rust nightly | |
run: | | |
rustup toolchain install nightly | |
rustup component add clippy --toolchain nightly | |
- name: Restore cargo caches | |
uses: Swatinem/rust-cache@v2 | |
- name: Run clippy | |
run: cargo clippy --all-features --tests --examples -- -D warnings | |
- name: Run clippy nightly | |
run: | | |
cargo +nightly clippy --all-features --tests --examples | |
WARNS=$(cargo +nightly clippy --all-features --tests --examples --message-format=json | jq -s '[.[] | select(.reason == "compiler-message")] | length') | |
if [[ $WARNS -ne 0 ]]; then | |
echo "::warning title=nightly clippy::Detected $WARNS warnings" | |
fi | |
- name: Run clippy nightly for benches | |
run: | | |
cargo +nightly clippy --all-features --benches -- -A clippy::incompatible_msrv | |
WARNS=$(cargo +nightly clippy --all-features --benches --message-format=json -- -A clippy::incompatible_msrv | jq -s '[.[] | select(.reason == "compiler-message")] | length') | |
if [[ $WARNS -ne 0 ]]; then | |
echo "::warning title=nightly clippy::Detected $WARNS warnings" | |
fi | |
check: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-latest', 'windows-latest', 'macos-latest'] | |
target: ['', 'x86_64-apple-ios', 'x86_64-unknown-freebsd', 'x86_64-unknown-illumos', 'aarch64-linux-android'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Disable bench dependencies | |
run: ./.github/workflows/disable-bench-deps.sh | |
- name: Install dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo bash ./.github/workflows/install-deps.sh | |
- name: Install Rust target | |
if: matrix.target != '' | |
run: rustup target add ${{ matrix.target }} | |
- name: Restore cargo caches | |
uses: Swatinem/rust-cache@v2 | |
- name: Run check | |
run: | | |
if [[ -z "${{ matrix.target }}" ]]; then | |
cargo check --all-features | |
else | |
cargo check --all-features --target ${{ matrix.target }} | |
fi | |
check-doc: | |
strategy: | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Disable bench dependencies | |
run: ./.github/workflows/disable-bench-deps.sh | |
- name: Install dependencies | |
run: sudo bash ./.github/workflows/install-deps.sh | |
- name: Install Rust nightly | |
run: rustup toolchain install nightly | |
- name: Restore cargo caches | |
uses: Swatinem/rust-cache@v2 | |
- name: Run rustdoc nightly | |
run: | | |
cd spdlog | |
cargo +nightly rustdoc --verbose -- -D warnings -A rustdoc::broken-intra-doc-links | |
cargo +nightly rustdoc --all-features --verbose -- -D warnings | |
cd ../spdlog-macros | |
cargo +nightly rustdoc --verbose -- -D warnings -A rustdoc::broken-intra-doc-links | |
cargo +nightly rustdoc --all-features --verbose -- -D warnings | |
check-msrv: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-latest', 'windows-latest', 'macos-latest'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Disable bench dependencies | |
run: ./.github/workflows/disable-bench-deps.sh | |
- name: Install dependencies (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo bash ./.github/workflows/install-deps.sh | |
- name: Install Rust nightly | |
run: rustup toolchain install nightly | |
- name: Install Rust ${{ env.rust_minver }} | |
run: rustup toolchain install ${{ env.rust_minver }} | |
- name: Restore cargo caches | |
uses: Swatinem/rust-cache@v2 | |
- name: Avoid dev-dependencies | |
run: | | |
# Some dev-dependencies require a newer version of Rust, but it doesn't matter for MSRV check | |
# This is a workaround for the cargo nightly option `-Z avoid-dev-deps` | |
perl -pi -e 's/\[dev-dependencies]/[workaround-avoid-dev-deps]/g' ./spdlog/Cargo.toml | |
- name: Downgrade dependencies to minimal versions | |
run: cargo +nightly update -Z minimal-versions | |
- name: Check MSRV for core with Rust ${{ env.rust_minver }} | |
run: cargo +${{ env.rust_minver }} check --locked --all-features --verbose | |
bench: | |
needs: [test, check] | |
strategy: | |
fail-fast: false | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Disable bench dependencies | |
run: ./.github/workflows/disable-bench-deps.sh | |
- name: Install Rust nightly | |
run: rustup toolchain install nightly | |
- name: Restore cargo caches | |
uses: Swatinem/rust-cache@v2 | |
- name: Run benchmark | |
run: | | |
cargo +nightly bench --features "multi-thread,runtime-pattern,serde_json,log" \ | |
--bench spdlog_rs \ | |
--bench spdlog_rs_pattern \ | |
--bench spdlog_rs_log_crate_proxy \ | |
| tee bench-results.txt | |
- name: Discard irrelevant changes | |
run: git checkout -- spdlog/Cargo.toml | |
- name: Process results | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
name: spdlog-rs on Linux | |
tool: cargo | |
output-file-path: bench-results.txt | |
benchmark-data-dir-path: docs/dev/benchmarks | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
summary-always: true | |
comment-on-alert: true | |
alert-comment-cc-users: '@SpriteOvO' | |
- name: Push results to GitHub Pages branch | |
if: github.event_name != 'pull_request' && (github.ref_name == 'main' || github.ref_name == 'main-dev') | |
run: git push 'https://${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git' gh-pages:gh-pages |