Skip to content

Update to cap-std 3.0.0. #293

Update to cap-std 3.0.0.

Update to cap-std 3.0.0. #293

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
jobs:
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ./.github/actions/install-rust
with:
toolchain: stable
- run: cargo fmt --all -- --check
check_cross:
name: Check Cross-Compilation
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [stable, beta]
include:
- build: stable
os: ubuntu-latest
rust: stable
- build: beta
os: ubuntu-latest
rust: beta
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ./.github/actions/install-rust
with:
toolchain: ${{ matrix.rust }}
- name: Install musl-tools
run: |
set -ex
sudo apt-get update
sudo apt-get install -y musl-tools
- run: >
rustup target add
x86_64-unknown-linux-musl
x86_64-unknown-linux-gnux32
x86_64-linux-android
x86_64-apple-darwin
x86_64-unknown-freebsd
x86_64-unknown-netbsd
i686-unknown-linux-gnu
i686-unknown-linux-musl
x86_64-pc-windows-msvc
x86_64-pc-windows-gnu
i686-pc-windows-msvc
i686-pc-windows-gnu
wasm32-unknown-emscripten
riscv64gc-unknown-linux-gnu
arm-unknown-linux-gnueabihf
aarch64-linux-android
aarch64-pc-windows-msvc
- name: Install cross-compilation tools
run: |
set -ex
sudo apt-get update
sudo apt-get install -y gcc-arm-linux-gnueabihf gcc-i686-linux-gnu gcc-aarch64-linux-gnu gcc-riscv64-linux-gnu musl-tools
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=x86_64-unknown-linux-musl
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=x86_64-unknown-linux-gnux32
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=x86_64-linux-android
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=x86_64-apple-darwin
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=x86_64-unknown-freebsd
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=x86_64-unknown-netbsd
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=i686-unknown-linux-gnu
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=i686-unknown-linux-musl
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=x86_64-pc-windows-msvc
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=x86_64-pc-windows-gnu
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=i686-pc-windows-msvc
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=i686-pc-windows-gnu
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=wasm32-unknown-emscripten
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=riscv64gc-unknown-linux-gnu
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=arm-unknown-linux-gnueabihf
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=aarch64-linux-android
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=aarch64-pc-windows-msvc
check_cross_nightly:
name: Check Cross-Compilation on Rust nightly
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [nightly]
include:
- build: nightly
os: ubuntu-latest
rust: nightly
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ./.github/actions/install-rust
with:
toolchain: ${{ matrix.rust }}
- run: sudo apt-get install libssl-dev pkg-config
- name: Install musl-tools
run: |
set -ex
sudo apt-get update
sudo apt-get install -y musl-tools
- run: >
rustup target add
x86_64-unknown-linux-musl
x86_64-unknown-linux-gnux32
x86_64-linux-android
x86_64-apple-darwin
x86_64-unknown-freebsd
x86_64-unknown-netbsd
i686-unknown-linux-gnu
i686-unknown-linux-musl
x86_64-pc-windows-msvc
x86_64-pc-windows-gnu
i686-pc-windows-msvc
i686-pc-windows-gnu
x86_64-unknown-fuchsia
wasm32-unknown-emscripten
# x86_64-fuchsia was renamed to x86_64-unknown-fuchsia so for now just
# test it on nightly which has the new name.
- run: cargo check --workspace --bins --examples --tests --features=cap_std_impls --release -vv --target=x86_64-unknown-fuchsia
# socket2, cap_async_std_impls, and cap_async_std_impls_fs_utf8 temporarily
# disabled until I/O safety trait impls are available
- run: cargo check --workspace --all-targets --all-features --release -vv
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=x86_64-unknown-linux-musl
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=x86_64-unknown-linux-gnux32
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=x86_64-linux-android
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=x86_64-apple-darwin
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=x86_64-unknown-freebsd
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=x86_64-unknown-netbsd
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=i686-unknown-linux-gnu
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=i686-unknown-linux-musl
# socket2 temporarily disabled until I/O safety trait impls are available
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=x86_64-pc-windows-msvc
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=x86_64-pc-windows-gnu
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=i686-pc-windows-msvc
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=i686-pc-windows-gnu
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=x86_64-unknown-fuchsia
# socket2 doesn't yet support wasm32-unknown-emscripten
- run: cargo check --workspace --all-targets --features=cap_std_impls,cap_std_impls_fs_utf8,char-device,use_os_pipe,socketpair --release -vv --target=wasm32-unknown-emscripten
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [stable, windows, macos, macos-11.0, beta, ubuntu-20.04, windows-2019, aarch64-ubuntu]
include:
- build: stable
os: ubuntu-latest
rust: stable
- build: windows
os: windows-latest
rust: stable
- build: macos
os: macos-latest
rust: stable
- build: macos-11.0
os: macos-11.0
rust: stable
- build: beta
os: ubuntu-latest
rust: beta
- build: ubuntu-20.04
os: ubuntu-20.04
rust: stable
- build: windows-2019
os: windows-2019
rust: stable
- build: aarch64-ubuntu
os: ubuntu-latest
rust: stable
target: aarch64-unknown-linux-gnu
gcc_package: gcc-aarch64-linux-gnu
gcc: aarch64-linux-gnu-gcc
qemu: qemu-aarch64 -L /usr/aarch64-linux-gnu
qemu_target: aarch64-linux-user
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ./.github/actions/install-rust
with:
toolchain: ${{ matrix.rust }}
- name: Install cross-compilation tools
run: |
set -ex
sudo apt-get update
sudo apt-get install -y ${{ matrix.gcc_package }} ninja-build
# Download and build qemu from source since the most recent release is
# way faster at arm emulation than the current version github actions'
# ubuntu image uses. Disable as much as we can to get it to build
# quickly.
cd
curl https://download.qemu.org/qemu-6.1.0.tar.xz | tar xJf -
cd qemu-6.1.0
./configure --target-list=${{ matrix.qemu_target }} --prefix=$HOME/qemu --disable-tools --disable-slirp --disable-fdt --disable-capstone --disable-docs
make -j$(nproc) install
# Configure Cargo for cross compilation and tell it how it can run
# cross executables
upcase=$(echo ${{ matrix.target }} | awk '{ print toupper($0) }' | sed 's/-/_/g')
echo CARGO_TARGET_${upcase}_RUNNER=$HOME/qemu/bin/${{ matrix.qemu }} >> $GITHUB_ENV
echo CARGO_TARGET_${upcase}_LINKER=${{ matrix.gcc }} >> $GITHUB_ENV
if: matrix.qemu != '' && matrix.os == 'ubuntu-latest'
- name: Native testing
run: cargo test --features cap_std_impls --workspace
env:
RUST_BACKTRACE: 1
if: matrix.target == ''
- name: Cross testing
run: |
rustup target add ${{ matrix.target }}
cargo test --features cap_std_impls --workspace --target=${{ matrix.target }}
env:
RUST_BACKTRACE: 1
if: matrix.target != ''
test_nightly:
name: Test with Rust nightly
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [ubuntu, windows]
include:
- build: ubuntu
os: ubuntu-latest
rust: nightly
- build: windows
os: windows-latest
rust: nightly
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ./.github/actions/install-rust
with:
toolchain: ${{ matrix.rust }}
- run: sudo apt-get install libssl-dev pkg-config
if: matrix.os == 'ubuntu-latest'
- run: cargo test --all-features --workspace
test_musl:
name: Test on Musl
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [ubuntu]
include:
- build: ubuntu
os: ubuntu-latest
rust: stable
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ./.github/actions/install-rust
with:
toolchain: ${{ matrix.rust }}
- name: Install musl-tools
run: |
set -ex
sudo apt-get update
sudo apt-get install -y musl-tools
- run: rustup target add x86_64-unknown-linux-musl
- run: cargo test --target x86_64-unknown-linux-musl --features cap_std_impls --workspace