diff --git a/.cirrus.yml b/.cirrus.yml index d1e8a7a..59f7bae 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 @@ -60,13 +58,14 @@ openbsd_task: compute_engine_instance: image_project: pg-ci-images # https://github.com/anarazel/pg-vm-images/blob/main/packer/openbsd.pkrvars.hcl - image: family/pg-ci-openbsd-vanilla-7-2 + image: family/pg-ci-openbsd-vanilla-7-3 platform: openbsd env: TARGET: x86_64-unknown-openbsd 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..e4c8e64 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' @@ -40,6 +40,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 + - os: ubuntu-latest + rust: nightly + target: x86_64-pc-windows-gnu # Wine steps: - uses: actions/checkout@v3 - name: Install Rust @@ -47,6 +53,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 @@ -65,62 +75,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 }}