diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index a0c8143..0000000 --- a/.cirrus.yml +++ /dev/null @@ -1,61 +0,0 @@ -only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'master') -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 - RUSTFLAGS: -D warnings - RUSTUP_MAX_RETRIES: '10' - -freebsd_task: - name: test ($TARGET) - freebsd_instance: - image_family: freebsd-12-4 - matrix: - - env: - TARGET: x86_64-unknown-freebsd - - 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: - - . $HOME/.cargo/env - - cargo test --target $TARGET - -netbsd_task: - name: test ($TARGET) - compute_engine_instance: - image_project: pg-ci-images - # https://github.com/anarazel/pg-vm-images/blob/main/packer/netbsd.pkrvars.hcl - image: family/pg-ci-netbsd-vanilla-9-3 - platform: netbsd - env: - TARGET: x86_64-unknown-netbsd - setup_script: - - pkgin -y install git - - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable - test_script: - - . $HOME/.cargo/env - - cargo test - -openbsd_task: - name: test ($TARGET) - 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 - 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 - test_script: - - cargo test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b6d03b..feec702 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,14 +31,16 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - rust: [nightly, beta, stable] + os: [ubuntu-latest] + rust: [stable] 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 }} - run: cargo build --all --all-features --all-targets + - run: sudo apt update && sudo apt install -y seatd && (seatd &) && ls /var/run + if: startsWith(matrix.os, 'ubuntu') - name: Run cargo check (without dev-dependencies to catch missing feature flags) if: startsWith(matrix.rust, 'nightly') run: cargo check -Z features=dev_dep @@ -49,103 +51,5 @@ jobs: # - name: Check selected Tier 3 targets # if: startsWith(matrix.rust, 'nightly') && matrix.os == 'ubuntu-latest' # run: cargo check -Z build-std --target=riscv32imc-esp-espidf + - run: sudo chown runner:runner /var/run/seatd.sock - run: cargo test - - # Copied from: https://github.com/rust-lang/stacker/pull/19/files - windows_gnu: - runs-on: windows-latest - strategy: - matrix: - rust: [nightly] - target: - - x86_64-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 }} - - run: rustup target add ${{ matrix.target }} - - run: cargo build --target ${{ matrix.target }} --all --all-features --all-targets - - run: cargo test --target ${{ matrix.target }} - - cross: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - steps: - - uses: actions/checkout@v4 - - 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: 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 - - msrv: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - # When updating this, the reminder to update the minimum supported - # Rust version in Cargo.toml. - rust: ['1.63'] - 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 }} - - run: cargo build - - clippy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Rust - run: rustup update stable - - run: cargo clippy --all-features --all-targets - - fmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Rust - run: rustup update stable - - run: cargo fmt --all --check - - security_audit: - permissions: - checks: write - contents: read - issues: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # https://github.com/rustsec/audit-check/issues/2 - - uses: rustsec/audit-check@master - with: - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/tests/async.rs b/tests/async.rs index 9218e71..62860de 100644 --- a/tests/async.rs +++ b/tests/async.rs @@ -33,6 +33,17 @@ fn spawn( Box::pin(async move { r.recv().await.unwrap() }) } +#[cfg(target_os = "linux")] +#[test] +fn socket() { + future::block_on(async { + let _sock = + async_io::Async::::connect("/var/run/seatd.sock") + .await + .unwrap(); + }); +} + #[test] fn tcp_connect() -> io::Result<()> { future::block_on(async {