Skip to content

feat: Support AsyncRead+Write for receiver #87

feat: Support AsyncRead+Write for receiver

feat: Support AsyncRead+Write for receiver #87

Workflow file for this run

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_call:
name: Test
jobs:
dump-ctx:
name: Context
runs-on: ubuntu-latest
steps:
- name: Dump Github context
uses: crazy-max/ghaction-dump-context@v2
build-and-release:
name: Build and Test
strategy:
fail-fast: false
matrix:
target:
# BSDs
#- { platform: aarch64-unknown-freebsd, os: linux, runner: ubuntu-latest, run: true } # No rust core
- { platform: i686-unknown-freebsd, os: linux, runner: ubuntu-latest, run: false }
- { platform: x86_64-unknown-freebsd, os: linux, runner: ubuntu-latest, run: false }
#- { platform: aarch64-unknown-netbsd, os: linux, runner: ubuntu-latest, run: true } # No rust core
- { platform: x86_64-unknown-netbsd, os: linux, runner: ubuntu-latest, run: false }
# WASM
#- { platform: wasm32-wasi, os: linux, runner: ubuntu-latest, run: true } # Incompatible Tokio
# Android (redundant with Linux Musl)
- { platform: aarch64-linux-android, os: linux, runner: ubuntu-latest, run: true }
- { platform: arm-linux-androideabi, os: linux, runner: ubuntu-latest, run: true }
- { platform: i686-linux-android, os: linux, runner: ubuntu-latest, run: true }
- { platform: x86_64-linux-android, os: linux, runner: ubuntu-latest, run: true }
# Linux Musl
- { platform: aarch64-unknown-linux-musl, os: linux, runner: ubuntu-latest, run: true }
- { platform: arm-unknown-linux-musleabi, os: linux, runner: ubuntu-latest, run: true }
- { platform: i586-unknown-linux-musl, os: linux, runner: ubuntu-latest, run: true }
- { platform: i686-unknown-linux-musl, os: linux, runner: ubuntu-latest, run: true }
- { platform: x86_64-unknown-linux-musl, os: linux, runner: ubuntu-latest, run: true }
# Linux GNU
- { platform: aarch64-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
- { platform: arm-unknown-linux-gnueabi, os: linux, runner: ubuntu-latest, run: true }
- { platform: i586-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
- { platform: i686-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
- { platform: x86_64-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
#- { platform: mips-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true } # No rust core
#- { platform: mips64-unknown-linux-gnuabi64, os: linux, runner: ubuntu-latest, run: true } # No rust core
- { platform: powerpc-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
- { platform: powerpc64-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
#- { platform: riscv32gc-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true } # No rust core
- { platform: riscv64gc-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
- { platform: s390x-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
#- { platform: sparc-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true } # No rust core
- { platform: sparc64-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true }
# MacOS
- { platform: aarch64-apple-darwin, os: darwin, runner: macos-latest, run: false }
- { platform: x86_64-apple-darwin, os: darwin, runner: macos-latest, run: true }
# Windows
- { platform: aarch64-pc-windows-msvc, os: windows, runner: windows-latest, run: false }
- { platform: i586-pc-windows-msvc, os: windows, runner: windows-latest, run: false }
- { platform: i686-pc-windows-msvc, os: windows, runner: windows-latest, run: true }
- { platform: x86_64-pc-windows-msvc, os: windows, runner: windows-latest, run: true }
toolchain:
- stable
- nightly
runs-on: ${{ matrix.target.runner }}
services:
sshd:
image: ${{ (matrix.target.os == 'linux') && 'atmoz/sftp:alpine' || '' }}
ports:
- 2222:22
env:
SFTP_USERS: user:pass:1000
volumes:
- /tmp:/home/user/tmp
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with:
tool: protoc,sccache
- name: Install toolchain
if: ${{ !contains(matrix.toolchain, 'nightly') }}
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target.platform }}
toolchain: ${{ matrix.toolchain }}
components: rust-src,rust-docs,rustfmt,clippy
- name: Install toolchain (with miri)
if: contains(matrix.toolchain, 'nightly')
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target.platform }}
toolchain: ${{ matrix.toolchain }}
components: rust-src,rust-docs,rustfmt,clippy,miri
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target.platform }}
- name: Setup Cache
uses: Swatinem/[email protected]
with:
shared-key: "build-${{ matrix.toolchain }}-${{ matrix.target.platform }}"
- name: Build
run: |
cargo build --all --locked
- name: Test
if: matrix.target.run
run: |
cargo test --all --locked
- name: Test Release
if: matrix.target.run
run: |
cargo test --all --locked --release
- name: Test Miri
if: contains(matrix.toolchain, 'nightly')
run: |
cargo miri test --all --locked
- name: Format
run: |
cargo fmt --all --check
- name: Doc
if: matrix.target.os == 'linux'
run: |
RUSTDOCFLAGS="-Dwarnings" cargo doc
- name: Example
if: matrix.target.os == 'linux' && matrix.target.run
timeout-minutes: 1
run: |
set -x
for example in examples/*.rs; do
example="${example#examples/}"
example="${example%.rs}"
RUST_LOG=trace cargo run --locked --example "$example"
done
- name: Clippy
run: |
cargo clippy --all --no-deps -- -Dwarnings -Dunused-crate-dependencies