CI #1140
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 | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: '0 2 * * 0' | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_NET_GIT_FETCH_WITH_CLI: true | |
| CARGO_NET_RETRY: 10 | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| RUSTFLAGS: -D warnings | |
| RUSTDOCFLAGS: -D warnings | |
| RUSTUP_MAX_RETRIES: 10 | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| fmt: | |
| uses: smol-rs/.github/.github/workflows/fmt.yml@main | |
| clippy: | |
| uses: smol-rs/.github/.github/workflows/clippy.yml@main | |
| with: | |
| # macOS for kqueue, Windows for iocp, illumos for port, fuchsia for poll. | |
| additional-targets: aarch64-apple-darwin x86_64-pc-windows-msvc x86_64-unknown-illumos x86_64-unknown-fuchsia | |
| security_audit: | |
| uses: smol-rs/.github/.github/workflows/security_audit.yml@main | |
| permissions: | |
| checks: write | |
| contents: read | |
| issues: write | |
| secrets: inherit | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| rust: [nightly, beta, stable] | |
| include: | |
| - os: windows-latest | |
| rust: nightly-x86_64-pc-windows-gnu | |
| - os: windows-latest | |
| rust: nightly-i686-pc-windows-msvc | |
| - os: windows-latest | |
| rust: nightly-i686-pc-windows-gnu | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| # --no-self-update is necessary because the windows environment cannot self-update rustup.exe. | |
| run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} | |
| - name: Install cargo-hack and cargo-minimal-versions | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-hack,cargo-minimal-versions | |
| - run: cargo build --all --all-features --all-targets | |
| - run: cargo test | |
| - run: cargo test | |
| env: | |
| # Note: This cfg is intended to make it easy for polling developers to test | |
| # the backend that uses poll, and is not a public API. | |
| RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg polling_test_poll_backend | |
| if: startsWith(matrix.os, 'ubuntu') | |
| - run: cargo test | |
| env: | |
| # Note: This cfg is intended to make it easy for polling developers to test | |
| # the backend that uses pipes, and is not a public API. | |
| RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg polling_test_epoll_pipe | |
| if: startsWith(matrix.os, 'ubuntu') | |
| - run: cargo hack build --feature-powerset --no-dev-deps | |
| - run: cargo minimal-versions build --all --all-features | |
| - name: Clone async-io | |
| run: git clone https://github.com/smol-rs/async-io.git | |
| # The async-io Cargo.toml already has a patch section at the bottom, so we | |
| # can just add this. | |
| - name: Patch polling | |
| run: echo 'polling = { path = ".." }' >> async-io/Cargo.toml | |
| - name: Test async-io | |
| run: cargo test --manifest-path=async-io/Cargo.toml | |
| cross: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| rust: [nightly, stable] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} | |
| - name: Install cross | |
| uses: taiki-e/install-action@cross | |
| - name: Add rust-src | |
| if: startsWith(matrix.rust, 'nightly') | |
| run: rustup component add rust-src | |
| # We don't test BSDs, since we already test them in Cirrus. | |
| - name: Android | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: cross test --target arm-linux-androideabi | |
| - name: iOS | |
| if: startsWith(matrix.os, 'macos') | |
| run: | | |
| rustup target add aarch64-apple-ios | |
| cross build --target aarch64-apple-ios | |
| - name: Linux x32 | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| rustup target add x86_64-unknown-linux-gnux32 | |
| cross check --target x86_64-unknown-linux-gnux32 | |
| - name: Fuchsia | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| rustup target add x86_64-unknown-fuchsia | |
| cargo build --target x86_64-unknown-fuchsia | |
| - name: illumos | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| rustup target add x86_64-unknown-illumos | |
| cargo build --target x86_64-unknown-illumos | |
| - name: Redox | |
| if: startsWith(matrix.rust, 'nightly') && startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| rustup target add x86_64-unknown-redox | |
| cargo check --target x86_64-unknown-redox | |
| - name: HermitOS | |
| if: startsWith(matrix.rust, 'nightly') && startsWith(matrix.os, 'ubuntu') | |
| run: cargo check -Z build-std --target x86_64-unknown-hermit | |
| - name: Check haiku | |
| if: startsWith(matrix.rust, 'nightly') && startsWith(matrix.os, 'ubuntu') | |
| run: cargo check -Z build-std --target x86_64-unknown-haiku | |
| # Vita check is broken until this issue is fixed: | |
| # https://github.com/bytecodealliance/rustix/issues/1576 | |
| #- name: Check vita | |
| # if: startsWith(matrix.rust, 'nightly') && startsWith(matrix.os, 'ubuntu') | |
| # run: cargo check -Z build-std --target armv7-sony-vita-newlibeabihf | |
| - name: Check ESP-IDF | |
| if: startsWith(matrix.rust, 'nightly') && startsWith(matrix.os, 'ubuntu') | |
| run: cargo check -Z build-std --target riscv32imc-esp-espidf | |
| wine: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| run: rustup update stable | |
| - uses: taiki-e/setup-cross-toolchain-action@v1 | |
| with: | |
| target: x86_64-pc-windows-gnu | |
| - run: cargo test --target x86_64-pc-windows-gnu | |
| msrv: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install cargo-hack | |
| uses: taiki-e/install-action@cargo-hack | |
| - run: cargo hack build --no-dev-deps --rust-version | |
| - run: cargo hack build --no-dev-deps --rust-version --target x86_64-unknown-freebsd | |
| if: startsWith(matrix.os, 'ubuntu') | |
| - run: cargo hack build --no-dev-deps --rust-version --target x86_64-unknown-netbsd | |
| if: startsWith(matrix.os, 'ubuntu') |