name: CI on: push: branches: - main - "v*.x" pull_request: schedule: - cron: '30 3 * * 2' workflow_dispatch: jobs: test: name: run tests strategy: matrix: platform: [ubuntu-latest, macos-latest, windows-latest] toolchain: [stable, 1.87.0] # MSRV include: - platform: windows-latest exe_suffix: .exe runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v7 - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} - run: mkdir artifacts - name: Build with default features run: | cargo build cp target/debug/tldr${{ matrix.exe_suffix}} artifacts/tldr-default${{ matrix.exe_suffix}} - name: Build with logging and Rustls with webpki roots run: | cargo build --features logging,rustls-with-webpki-roots --no-default-features cp target/debug/tldr${{ matrix.exe_suffix}} artifacts/tldr-logging-rustls-webpki${{ matrix.exe_suffix}} - name: Build with native TLS backend run: | # expects runners have the proper Native SSL library cargo build --features native-tls --no-default-features cp target/debug/tldr${{ matrix.exe_suffix}} artifacts/tldr-native-tls${{ matrix.exe_suffix}} - uses: actions/upload-artifact@v7 with: name: tldr-debug-build-${{ matrix.platform }}-rust-${{ matrix.toolchain }} path: artifacts/ - name: Run tests run: cargo test -- --test-threads 1 clippy: name: run clippy lints runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: dtolnay/rust-toolchain@master with: toolchain: stable components: clippy - name: run clippy lints run: cargo clippy --all-targets --features logging fmt: name: run rustfmt runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: dtolnay/rust-toolchain@master with: toolchain: stable components: rustfmt - name: run rustfmt run: cargo fmt --all -- --check docs: name: build docs runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - name: Setup mdBook uses: peaceiris/actions-mdbook@v2 with: mdbook-version: '0.4.4' - name: Setup toolchain uses: dtolnay/rust-toolchain@master with: toolchain: stable - name: Build run: cargo build - name: Ensure that docs can be built run: cd docs && mdbook build - name: Generate usage string run: cargo run -- --help > docs/src/usage-actual.txt - name: Ensure that usage string is up to date run: diff docs/src/usage{,-actual}.txt