Repository navigation
Do not query if all standard I/O streams are redirected #278
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: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: -Dwarnings | |
| jobs: | |
| pre-build: | |
| name: Pre-Build | |
| runs-on: ubuntu-latest | |
| outputs: | |
| rust-version: ${{ steps.rust-version.outputs.rust-version }} | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # @v6 | |
| - name: Determine Rust Version | |
| id: rust-version | |
| run: | | |
| rust_version=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "terminal-colorsaurus") | .rust_version') | |
| echo "rust-version=$rust_version" >> "$GITHUB_OUTPUT" | |
| build: | |
| needs: pre-build | |
| name: ${{ format('Build ({0})', matrix.rust-version) }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| rust-version: ['${{needs.pre-build.outputs.rust-version}}', stable, nightly] | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # @v6 | |
| - uses: taiki-e/install-action@50cee16bd6b97b2579572f83cfa1c0a721b1e336 # @v2 | |
| with: | |
| tool: just | |
| - name: Use Rust ${{matrix.rust-version}} | |
| if: matrix.rust-version != 'stable' | |
| run: rustup override set '${{matrix.rust-version}}' | |
| - name: Install Components | |
| if: matrix.rust-version != 'stable' | |
| run: rustup component add clippy | |
| - name: Build | |
| run: cargo build --workspace --all-features | |
| - name: Check | |
| run: just check | |
| docs: | |
| name: Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # @v6 | |
| - uses: taiki-e/install-action@50cee16bd6b97b2579572f83cfa1c0a721b1e336 # @v2 | |
| with: | |
| tool: just | |
| - run: rustup override set nightly | |
| - uses: dtolnay/install@982daea0f5d846abc3c83e01a6a1d73c040047c1 # @cargo-docs-rs | |
| - name: Build Docs | |
| run: just doc | |
| env: | |
| RUSTDOCFLAGS: -Dwarnings | |
| - name: Build Docs | |
| run: just doc xterm-color | |
| env: | |
| RUSTDOCFLAGS: -Dwarnings | |
| lint: | |
| runs-on: ubuntu-latest | |
| name: Lint | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # @v6 | |
| - name: Check format | |
| run: cargo fmt -- --check | |
| - name: Run clippy | |
| run: cargo clippy --workspace --all-targets --all-features -- --deny warnings | |
| - uses: EmbarkStudios/cargo-deny-action@76cd80eb775d7bbbd2d80292136d74d39e1b4918 # @v2 | |
| - name: Check spelling | |
| uses: crate-ci/typos@1368a15067646c7e74e98c4f65658df1d034d484 # @v1 | |
| test: | |
| name: Test | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # @v6 | |
| - name: Run tests | |
| run: cargo test --workspace --all-features | |
| - uses: taiki-e/install-action@50cee16bd6b97b2579572f83cfa1c0a721b1e336 | |
| with: | |
| tool: nextest | |
| - name: Run tests with nextest | |
| run: cargo nextest run --workspace --all-features | |
| test_package: | |
| name: Test Package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # @v6 | |
| - uses: taiki-e/install-action@50cee16bd6b97b2579572f83cfa1c0a721b1e336 # @v2 | |
| with: | |
| tool: just | |
| - run: just test-package xterm-color | |
| - run: just test-package terminal-colorsaurus |