From 6fc1839a1f51b2cd8e6a456d9983833db5fe288d Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Tue, 18 Jul 2023 02:54:45 +0900 Subject: [PATCH] wip --- .cirrus.yml | 9 +++-- .github/workflows/ci.yml | 71 +++++++++++++--------------------------- Cross.toml | 3 -- 3 files changed, 26 insertions(+), 57 deletions(-) delete mode 100644 Cross.toml diff --git a/.cirrus.yml b/.cirrus.yml index d1e8a7a..7398846 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,10 +1,8 @@ -only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'master') +only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'taiki-e/ci') auto_cancellation: $CIRRUS_BRANCH != 'master' env: CARGO_INCREMENTAL: '0' - CARGO_NET_GIT_FETCH_WITH_CLI: 'true' CARGO_NET_RETRY: '10' - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: 'sparse' CARGO_TERM_COLOR: always RUST_BACKTRACE: '1' RUSTDOCFLAGS: -D warnings @@ -21,11 +19,11 @@ freebsd_task: - env: TARGET: i686-unknown-freebsd setup_script: + # https://github.com/cirruslabs/cirrus-ci-docs/issues/483 + - sudo sysctl net.inet.tcp.blackhole=0 - pkg install -y git - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable --target $TARGET test_script: - # https://github.com/cirruslabs/cirrus-ci-docs/issues/483 - - sudo sysctl net.inet.tcp.blackhole=0 - . $HOME/.cargo/env - cargo test --target $TARGET # Test async-io @@ -67,6 +65,7 @@ openbsd_task: setup_script: # OpenBSD is tier 3 target, so install rust from package manager instead of rustup - pkg_add git rust + - rustc -Vv test_script: - cargo test # Test async-io diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff52e57..5fc9512 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: pull_request: push: branches: - - master + - taiki-e/ci schedule: - cron: '0 2 * * 0' @@ -31,6 +31,7 @@ jobs: strategy: fail-fast: false matrix: + target: [''] os: [ubuntu-latest, windows-latest, macos-latest] rust: [nightly, beta, stable] include: @@ -40,6 +41,12 @@ jobs: rust: nightly-i686-pc-windows-msvc - os: windows-latest rust: nightly-i686-pc-windows-gnu + - os: ubuntu-latest + rust: nightly + target: arm-linux-androideabi@21 # epoll_create1 requires API level 21+ + - os: ubuntu-latest + rust: nightly + target: x86_64-pc-windows-gnu # Wine steps: - uses: actions/checkout@v3 - name: Install Rust @@ -47,6 +54,10 @@ jobs: run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} - name: Install cargo-hack uses: taiki-e/install-action@cargo-hack + - uses: taiki-e/setup-cross-toolchain-action@more + with: + target: ${{ matrix.target }} + if: matrix.target != '' - run: cargo build --all --all-features --all-targets - run: cargo test - run: cargo test @@ -54,7 +65,7 @@ jobs: # 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') + if: startsWith(matrix.os, 'ubuntu') && matrix.target == '' - run: cargo hack build --feature-powerset --no-dev-deps - name: Clone async-io run: git clone https://github.com/smol-rs/async-io.git @@ -65,62 +76,24 @@ jobs: - name: Test async-io run: cargo test --manifest-path=async-io/Cargo.toml + # Android and Windows are tested in test job. + # BSDs are tested in Cirrus CI. cross: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install Rust run: rustup update stable - - name: Install cross - uses: taiki-e/install-action@cross - # 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: Install Targets + run: rustup target add aarch64-apple-ios x86_64-unknown-linux-gnux32 x86_64-unknown-fuchsia x86_64-unknown-illumos - name: iOS - if: startsWith(matrix.os, 'macos') - run: | - rustup target add aarch64-apple-ios - cross build --target aarch64-apple-ios + run: cargo 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 + run: cargo build --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 + run: 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 - - wine: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - run: rustup update stable - - uses: taiki-e/setup-cross-toolchain-action@v1 - with: - target: x86_64-pc-windows-gnu - runner: wine@7.13 - - run: cargo test --target x86_64-pc-windows-gnu - - name: Clone async-io - run: git clone https://github.com/smol-rs/async-io.git - - name: Add patch section - run: echo '[patch.crates-io]' >> async-io/Cargo.toml - - name: Patch polling - run: echo 'polling = { path = ".." }' >> async-io/Cargo.toml - - name: Test async-io - run: cargo test --manifest-path=async-io/Cargo.toml + run: cargo build --target x86_64-unknown-illumos msrv: runs-on: ${{ matrix.os }} diff --git a/Cross.toml b/Cross.toml deleted file mode 100644 index 856f9b4..0000000 --- a/Cross.toml +++ /dev/null @@ -1,3 +0,0 @@ -[target.arm-linux-androideabi] -# Workaround https://github.com/cross-rs/cross/issues/1128 / https://github.com/rust-lang/rust/issues/103673 -image = "ghcr.io/cross-rs/arm-linux-androideabi:edge"