From 033ee88e193e89e6a6a9f3387c4eb0aaa15bf82d Mon Sep 17 00:00:00 2001 From: Goat Date: Sat, 23 Nov 2024 22:48:05 +0300 Subject: [PATCH] Add cross-compilation in CI --- .github/workflows/checks_and_tests.yml | 33 ++++++++++++++++++++++++++ README.md | 15 +++++++++--- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checks_and_tests.yml b/.github/workflows/checks_and_tests.yml index 0621809..779ff6e 100644 --- a/.github/workflows/checks_and_tests.yml +++ b/.github/workflows/checks_and_tests.yml @@ -40,3 +40,36 @@ jobs: - name: Run rustdoc for Tokio configuration run: cargo doc --features tokio --no-deps + + xcompile: + strategy: + fail-fast: false + matrix: + target: [aarch64-linux-android, x86_64-unknown-freebsd] + toolchain: ["1.75.0", nightly] + + name: ${{ matrix.toolchain }} on ${{ matrix.target }} (no tests) + runs-on: ubuntu-latest + env: + RUSTFLAGS: --cfg ci + steps: + - name: Checkout the repository + uses: actions/checkout@v4 + + - name: Install Rust + run: | + rustup toolchain install ${{ matrix.toolchain }} --profile minimal --component clippy --no-self-update + rustup default ${{ matrix.toolchain }} + rustup target add ${{ matrix.target }} + + - name: Run Clippy for default configuration + run: cargo clippy --target ${{ matrix.target }} -- -A unknown_lints + + - name: Run rustdoc for default configuration + run: cargo doc --target ${{ matrix.target }} --no-deps + + - name: Run Clippy for Tokio configuration + run: cargo clippy --target ${{ matrix.target }} --features tokio -- -A unknown_lints + + - name: Run rustdoc for Tokio configuration + run: cargo doc --target ${{ matrix.target }} --features tokio --no-deps diff --git a/README.md b/README.md index 68567c7..8d97b5d 100644 --- a/README.md +++ b/README.md @@ -53,13 +53,22 @@ platform to be demoted, although promotions quite obviously can happen as minor badge if anything is wrong on any of those systems - Certain `#[cfg]`-gated platform-specific features are supported with stable public APIs +##### Explicit support with incomplete CI +*OSes at this level: **FreeBSD**, **Android*** + +- Interprocess is expected to compile and succeed in running all tests – it would be a bug for it + not to +- GitHub Actions only allows Clippy and Rustdoc to be run for those targets in CI (via + cross-compilation) due to a lack of native VMs +- Certain `#[cfg]`-gated platform-specific features are supported with stable public APIs + ##### Explicit support without CI -*OSes at this level: **FreeBSD*** +*OSes at this level: currently none* - Interprocess is expected to compile and succeed in running all tests – it would be a bug for it not to -- Manual testing on local VMs is usually done before every release; CI is not provided solely - because GitHub Actions selfishly ignores the existence of those wonderful systems +- Manual testing on local VMs is usually done before every release; no CI happens because those + targets' standard library `.rlib`s cannot be installed via `rustup target add` - Certain `#[cfg]`-gated platform-specific features are supported with stable public APIs ##### Support by association