mirror of
https://github.com/n0-computer/iroh.git
synced 2026-11-29 08:01:13 +00:00
Bumps the github-actions group with 1 update: [mozilla-actions/sccache-action](https://github.com/mozilla-actions/sccache-action). Updates `mozilla-actions/sccache-action` from 0.0.10 to 0.0.11 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/mozilla-actions/sccache-action/releases">mozilla-actions/sccache-action's releases</a>.</em></p> <blockquote> <h2>v0.0.11</h2> <h2>What's Changed</h2> <ul> <li>Bump the github-actions group across 1 directory with 2 updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/259">Mozilla-Actions/sccache-action#259</a></li> <li>Bump jest-circus from 29.7.0 to 30.3.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/256">Mozilla-Actions/sccache-action#256</a></li> <li>Bump <code>@actions/io</code> from 2.0.0 to 3.0.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/253">Mozilla-Actions/sccache-action#253</a></li> <li>ci: verify committed dist/ matches a clean rebuild by <a href="https://github.com/potiuk"><code>@potiuk</code></a> in <a href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/252">Mozilla-Actions/sccache-action#252</a></li> <li>prepare the version 0.0.11 by <a href="https://github.com/sylvestre"><code>@sylvestre</code></a> in <a href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/262">Mozilla-Actions/sccache-action#262</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/potiuk"><code>@potiuk</code></a> made their first contribution in <a href="https://redirect.github.com/Mozilla-Actions/sccache-action/pull/252">Mozilla-Actions/sccache-action#252</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/Mozilla-Actions/sccache-action/compare/v0.0.10...v0.0.11">https://github.com/Mozilla-Actions/sccache-action/compare/v0.0.10...v0.0.11</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/Mozilla-Actions/sccache-action/commit/fc920bf0ec8de6ee65d409111f7ec508035751ba"><code>fc920bf</code></a> Merge pull request <a href="https://redirect.github.com/mozilla-actions/sccache-action/issues/262">#262</a> from sylvestre/0.0.11</li> <li><a href="https://github.com/Mozilla-Actions/sccache-action/commit/c5764fdf18812cf387df7c2e1207231e98bda733"><code>c5764fd</code></a> udpate dist files</li> <li><a href="https://github.com/Mozilla-Actions/sccache-action/commit/ce939d51f4b92b63a356b3bea7ce8ab412d11fe7"><code>ce939d5</code></a> update prettier</li> <li><a href="https://github.com/Mozilla-Actions/sccache-action/commit/fc24157e3f312f21d07f7e46aa06e8b312b2ebe9"><code>fc24157</code></a> prepare 0.0.11</li> <li><a href="https://github.com/Mozilla-Actions/sccache-action/commit/439ab273196533b9969dc62dad489114f628a9a7"><code>439ab27</code></a> README.md prepare the version 0.0.11</li> <li><a href="https://github.com/Mozilla-Actions/sccache-action/commit/a2fac7a0509e69fd5f53e62a09aa52c322e19f31"><code>a2fac7a</code></a> Merge pull request <a href="https://redirect.github.com/mozilla-actions/sccache-action/issues/252">#252</a> from potiuk/ci-verify-dist</li> <li><a href="https://github.com/Mozilla-Actions/sccache-action/commit/4c2e5f0f1a56c8ffc03b1313a9448706888ac5f8"><code>4c2e5f0</code></a> Merge pull request <a href="https://redirect.github.com/mozilla-actions/sccache-action/issues/253">#253</a> from Mozilla-Actions/dependabot/npm_and_yarn/actions/...</li> <li><a href="https://github.com/Mozilla-Actions/sccache-action/commit/772f27d055654c3dca4ae89a5a2b104da9f1e924"><code>772f27d</code></a> ci: verify committed dist/ matches a clean rebuild</li> <li><a href="https://github.com/Mozilla-Actions/sccache-action/commit/d270be534369e533247936a054689a64a94dfd9f"><code>d270be5</code></a> Merge pull request <a href="https://redirect.github.com/mozilla-actions/sccache-action/issues/256">#256</a> from Mozilla-Actions/dependabot/npm_and_yarn/jest-cir...</li> <li><a href="https://github.com/Mozilla-Actions/sccache-action/commit/52752ae2ccd59d0129ed6b1cb14da9d0d8c8d5ab"><code>52752ae</code></a> Merge pull request <a href="https://redirect.github.com/mozilla-actions/sccache-action/issues/259">#259</a> from Mozilla-Actions/dependabot/github_actions/github...</li> <li>Additional commits viewable in <a href="https://github.com/mozilla-actions/sccache-action/compare/v0.0.10...v0.0.11">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
555 lines
20 KiB
YAML
555 lines
20 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
types: ["labeled", "unlabeled", "opened", "synchronize", "reopened"]
|
|
merge_group:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
concurrency:
|
|
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
RUSTFLAGS: -Dwarnings
|
|
RUSTDOCFLAGS: -Dwarnings
|
|
MSRV: "1.91"
|
|
SCCACHE_CACHE_SIZE: "10G"
|
|
IROH_FORCE_STAGING_RELAYS: "1"
|
|
|
|
jobs:
|
|
pick-runner:
|
|
uses: "./.github/workflows/pick-runner.yml"
|
|
with:
|
|
min_free_runners: 3
|
|
secrets:
|
|
RUNNER_READ_TOKEN: ${{ secrets.RUNNER_READ_TOKEN }}
|
|
|
|
tests:
|
|
name: CI Test Suite
|
|
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')"
|
|
uses: "./.github/workflows/tests.yaml"
|
|
|
|
cross_build:
|
|
name: Cross Build Only
|
|
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')"
|
|
timeout-minutes: 30
|
|
needs: pick-runner
|
|
runs-on: ${{ fromJSON(needs.pick-runner.outputs.overflow_1) }}
|
|
# runs-on: [self-hosted, linux, X64]
|
|
env:
|
|
RUSTFLAGS: "-Dwarnings --cfg skip_patchbay"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
# cross tests are currently broken vor armv7 and aarch64
|
|
# see https://github.com/cross-rs/cross/issues/1311
|
|
# - armv7-linux-androideabi
|
|
# - aarch64-linux-android
|
|
# Freebsd execution fails in cross
|
|
# - i686-unknown-freebsd # Linking fails :/
|
|
- x86_64-unknown-freebsd
|
|
# Netbsd execution fails to link in cross
|
|
# - x86_64-unknown-netbsd
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install rust stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Cleanup Docker
|
|
continue-on-error: true
|
|
run: |
|
|
docker kill $(docker ps -q)
|
|
|
|
# See https://github.com/cross-rs/cross/issues/1222
|
|
- name: Cache cross
|
|
id: cache-cross
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: ~/.cargo/bin/cross
|
|
key: cross-${{ runner.os }}-${{ runner.arch }}
|
|
|
|
- name: Install cross
|
|
if: steps.cache-cross.outputs.cache-hit != 'true'
|
|
uses: taiki-e/install-action@cross
|
|
|
|
- name: build
|
|
# cross tests are currently broken vor armv7 and aarch64
|
|
# see https://github.com/cross-rs/cross/issues/1311. So on
|
|
# those platforms we only build but do not run tests.
|
|
run: cross build --all --target ${{ matrix.target }}
|
|
env:
|
|
RUST_LOG: ${{ runner.debug && 'TRACE' || 'DEBUG'}}
|
|
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: cc
|
|
|
|
android:
|
|
name: Android Build & Test
|
|
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')"
|
|
timeout-minutes: 30
|
|
runs-on: [self-hosted, linux, X64]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- target: aarch64-linux-android
|
|
- target: armv7-linux-androideabi
|
|
- target: x86_64-linux-android
|
|
api-level: 35
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Enable KVM for nested virtualization
|
|
if: matrix.target == 'x86_64-linux-android'
|
|
run: |
|
|
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666"' \
|
|
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
|
sudo udevadm control --reload-rules
|
|
sudo udevadm trigger --name-match=kvm
|
|
|
|
- name: Set up Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: "17"
|
|
|
|
- name: Setup Android SDK
|
|
uses: android-actions/setup-android@v4
|
|
|
|
# Pinned to a release tag (rather than @main) for supply-chain hygiene.
|
|
- name: Setup Android NDK
|
|
uses: nttld/setup-ndk@v1
|
|
id: setup-ndk
|
|
with:
|
|
ndk-version: r25c
|
|
add-to-path: true
|
|
|
|
- name: Install cargo-ndk
|
|
run: cargo install --version 4.1.2 cargo-ndk
|
|
|
|
# Replace cargo-ndk-runner with a wrapper that forwards RUST_LOG
|
|
# and RUST_BACKTRACE into the emulator shell. The upstream binary
|
|
# does `adb shell <bin>` without inheriting any host env.
|
|
#
|
|
# The wrapper also removes each binary from the guest once it has run.
|
|
# A full run pushes ~1.25GB of debug test binaries into /data/local/tmp
|
|
# and the guest data partition is only ~5.8GB, so leaving them behind
|
|
# accumulates across jobs (see the sweep in the emulator script below).
|
|
- name: Wrap cargo-ndk-runner to forward logging env
|
|
if: matrix.target == 'x86_64-linux-android'
|
|
run: |
|
|
cat > "$(which cargo-ndk-runner)" <<'WRAPPER'
|
|
#!/bin/sh
|
|
set -e
|
|
dev=/data/local/tmp/$(basename "$1")
|
|
adb push "$1" "$dev" >/dev/null
|
|
adb shell chmod 755 "$dev"
|
|
shift
|
|
set +e
|
|
adb shell "RUST_LOG=$RUST_LOG RUST_BACKTRACE=$RUST_BACKTRACE $dev $*"
|
|
rc=$?
|
|
adb shell rm -f "$dev" >/dev/null 2>&1
|
|
exit $rc
|
|
WRAPPER
|
|
chmod +x "$(which cargo-ndk-runner)"
|
|
|
|
- name: Build
|
|
if: matrix.target != 'x86_64-linux-android'
|
|
env:
|
|
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
|
run: cargo ndk --target ${{ matrix.target }} build
|
|
|
|
# Build all the test binaries up front so the emulator boot can
|
|
# overlap with compilation. cargo-ndk runs `cargo test --no-run`
|
|
# against each crate; the binaries land in
|
|
# target/$CARGO_NDK_TARGET/debug/deps/.
|
|
- name: Build workspace test binaries
|
|
if: matrix.target == 'x86_64-linux-android'
|
|
env:
|
|
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
|
CARGO_NDK_TARGET: ${{ matrix.target }}
|
|
run: |
|
|
cargo ndk test --no-run -p iroh-base --all-features
|
|
cargo ndk test --no-run -p iroh-dns --features tls-ring
|
|
cargo ndk test --no-run -p iroh-relay --features tls-ring,metrics
|
|
cargo ndk test --no-run -p iroh --features tls-ring,metrics,portmapper,test-utils
|
|
|
|
- name: Run workspace tests on Android emulator
|
|
if: matrix.target == 'x86_64-linux-android'
|
|
timeout-minutes: 30
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
env:
|
|
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
|
# Forwarded into the emulator by the cargo-ndk-runner wrapper.
|
|
RUST_LOG: trace
|
|
RUST_BACKTRACE: "1"
|
|
CARGO_NDK_TARGET: ${{ matrix.target }}
|
|
with:
|
|
api-level: ${{ matrix.api-level }}
|
|
arch: x86_64
|
|
target: google_apis
|
|
force-avd-creation: false
|
|
# `-dns-server` + `-netfast` + `-no-metrics` is the combination reported to give
|
|
# working public-internet connectivity on the GH-hosted runner; without them wlan0
|
|
# stays NO-CARRIER and every connect() to a public IP fails with ENETUNREACH.
|
|
# See https://github.com/ReactiveCircus/android-emulator-runner/issues/348#issuecomment-2578082030
|
|
#
|
|
# `-no-snapshot`: on persistent self-hosted runners the AVD survives between jobs,
|
|
# so the emulator quickboot-resumes from the previous run's snapshot. Resumed guests
|
|
# have broken networking (UDP DNS times out), failing DNS tests. Always cold boot
|
|
# and never save state.
|
|
emulator-options: -no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -dns-server 8.8.8.8 -netfast -no-metrics -no-snapshot
|
|
disable-animations: true
|
|
script: |
|
|
adb wait-for-device
|
|
# Wait for full boot and a working outbound TCP. `sys.boot_completed=1` fires
|
|
# before the radio/Wi-Fi stack comes up, and `ip route get 8.8.8.8` reports
|
|
# success while the kernel's per-network fwmark route is still missing. Probe
|
|
# an actual TCP connect to 8.8.8.8:53 instead - it exercises the same path
|
|
# the test sockets will use.
|
|
adb shell 'i=0; while [ -z "$(getprop sys.boot_completed | tr -d "\r")" ]; do i=$((i+1)); if [ $i -gt 300 ]; then exit 1; fi; sleep 2; done'
|
|
adb shell 'i=0; while ! nc -w 2 8.8.8.8 53 </dev/null >/dev/null 2>&1; do i=$((i+1)); if [ $i -gt 30 ]; then exit 1; fi; sleep 2; done'
|
|
# Disable IPv6: the emulator has site-local + link-local v6 but no global v6
|
|
# route, so connect() to a global v6 address hangs instead of returning ENETUNREACH.
|
|
adb root && adb wait-for-device
|
|
adb shell sysctl -w net.ipv6.conf.all.disable_ipv6=1 || true
|
|
adb shell sysctl -w net.ipv6.conf.default.disable_ipv6=1 || true
|
|
adb shell sysctl -w net.ipv6.conf.lo.disable_ipv6=1 || true
|
|
adb shell ip addr
|
|
# Sweep leftover test binaries out of the guest. `force-avd-creation: false`
|
|
# keeps the AVD between jobs, and `-no-snapshot` only disables the *RAM*
|
|
# quickboot snapshot - the userdata qcow2 overlay still persists on disk. A
|
|
# job that is cancelled or times out leaves its pushed binaries behind, so
|
|
# without this they accumulate until /data (~5.8G) fills and every `adb push`
|
|
# fails with ENOSPC. The runner wrapper deletes binaries as it goes; this
|
|
# catches what it could not.
|
|
adb shell 'rm -rf /data/local/tmp/*' || true
|
|
adb shell df -h /data
|
|
cargo ndk test -p iroh-base --all-features
|
|
cargo ndk test -p iroh-dns --features tls-ring
|
|
cargo ndk test -p iroh-relay --features tls-ring,metrics
|
|
cargo ndk test -p iroh --features tls-ring,metrics,portmapper,test-utils
|
|
|
|
cross_test:
|
|
name: Cross Test
|
|
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')"
|
|
timeout-minutes: 30
|
|
needs: pick-runner
|
|
runs-on: ${{ fromJSON(needs.pick-runner.outputs.overflow_3) }}
|
|
# runs-on: [self-hosted, linux, X64]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
- i686-unknown-linux-gnu
|
|
env:
|
|
RUSTFLAGS: "-Dwarnings --cfg skip_patchbay"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install rust stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Cleanup Docker
|
|
continue-on-error: true
|
|
run: |
|
|
docker kill $(docker ps -q)
|
|
|
|
# See https://github.com/cross-rs/cross/issues/1222
|
|
- name: Cache cross
|
|
id: cache-cross
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: ~/.cargo/bin/cross
|
|
key: cross-${{ runner.os }}-${{ runner.arch }}
|
|
|
|
- name: Install cross
|
|
if: steps.cache-cross.outputs.cache-hit != 'true'
|
|
uses: taiki-e/install-action@cross
|
|
|
|
- name: test
|
|
run: cross test --all --target ${{ matrix.target }} -- --test-threads=12
|
|
env:
|
|
RUST_LOG: ${{ runner.debug && 'TRACE' || 'DEBUG' }}
|
|
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: cc
|
|
|
|
wasm_test:
|
|
name: Build & test wasm32 for browsers
|
|
needs: pick-runner
|
|
runs-on: ${{ fromJSON(needs.pick-runner.outputs.overflow_4) }}
|
|
# runs-on: [self-hosted, linux, X64]
|
|
env:
|
|
RUSTFLAGS: '--cfg getrandom_backend="wasm_js"'
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Setup node.js version 22.5 # needed for browser-like websocket API support in node.js
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: 22.5
|
|
|
|
- name: Install stable toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Add wasm target
|
|
run: rustup target add wasm32-unknown-unknown
|
|
|
|
- name: Install wasm-bindgen-test-runner
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
# Match the version of wasm-bindgen used in Cargo.lock
|
|
tool: wasm-bindgen-cli@0.2.122
|
|
|
|
- name: Install wasm-tools
|
|
uses: bytecodealliance/actions/wasm-tools/setup@v1
|
|
|
|
- name: wasm32 build (iroh-base)
|
|
run: cargo build --target wasm32-unknown-unknown -p iroh-base --all-features
|
|
|
|
- name: wasm32 build (iroh-relay)
|
|
run: cargo build --target wasm32-unknown-unknown -p iroh-relay
|
|
|
|
- name: wasm32 build (iroh)
|
|
run: cargo build --target wasm32-unknown-unknown -p iroh
|
|
|
|
# If the Wasm file contains any 'import "env"' declarations, then
|
|
# some non-Wasm-compatible code made it into the final code.
|
|
- name: Ensure no 'import "env"' in iroh-relay Wasm
|
|
run: |
|
|
! wasm-tools print --skeleton target/wasm32-unknown-unknown/debug/iroh_relay.wasm | grep 'import "env"'
|
|
|
|
- name: Ensure no 'import "env"' in iroh Wasm
|
|
run: |
|
|
! wasm-tools print --skeleton target/wasm32-unknown-unknown/debug/iroh.wasm | grep 'import "env"'
|
|
|
|
- name: Run integration test in wasm
|
|
run: cargo test -p iroh --test integration --target=wasm32-unknown-unknown
|
|
|
|
check_semver:
|
|
needs: pick-runner
|
|
runs-on: ${{ fromJSON(needs.pick-runner.outputs.overflow_5) }}
|
|
# runs-on: [self-hosted, linux, X64]
|
|
env:
|
|
RUSTC_WRAPPER: "sccache"
|
|
SCCACHE_GHA_ENABLED: "on"
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Install sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.11
|
|
continue-on-error: true
|
|
- uses: ./.github/workflows/sccache-probe
|
|
- name: Check semver
|
|
# uses: obi1kenobi/cargo-semver-checks-action@v2
|
|
uses: n0-computer/cargo-semver-checks-action@feat-baseline
|
|
with:
|
|
package: iroh, iroh-base, iroh-dns, iroh-dns-server, iroh-relay
|
|
|
|
check_external_types:
|
|
timeout-minutes: 30
|
|
name: Check external types in public API
|
|
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')"
|
|
needs: pick-runner
|
|
runs-on: ${{ fromJSON(needs.pick-runner.outputs.overflow_9) }}
|
|
# runs-on: [self-hosted, linux, X64]
|
|
env:
|
|
RUSTC_WRAPPER: "sccache"
|
|
SCCACHE_GHA_ENABLED: "on"
|
|
# The tool drives an internal rustdoc invocation that only emits JSON
|
|
# for the analyzer, so the workflow-wide `-Dwarnings` would just turn
|
|
# unrelated rustdoc lints (e.g. `private-intra-doc-links`) into hard
|
|
# failures here. Clear it for this job.
|
|
RUSTDOCFLAGS: ""
|
|
# Pin to the nightly that the pinned `cargo-check-external-types`
|
|
# release was last tested against. Update both together.
|
|
CARGO_CHECK_EXTERNAL_TYPES_VERSION: "0.5.0"
|
|
TOOLCHAIN: "nightly-2026-03-20"
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ env.TOOLCHAIN }}
|
|
- name: Install sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.11
|
|
|
|
- name: Install cargo-check-external-types
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: |
|
|
cargo-make
|
|
cargo-check-external-types@${{ env.CARGO_CHECK_EXTERNAL_TYPES_VERSION }}
|
|
|
|
- name: Check external types
|
|
run: cargo make check-external-types
|
|
|
|
check_fmt:
|
|
timeout-minutes: 30
|
|
name: Checking fmt
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
RUSTC_WRAPPER: "sccache"
|
|
SCCACHE_GHA_ENABLED: "on"
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt
|
|
- uses: mozilla-actions/sccache-action@v0.0.11
|
|
continue-on-error: true
|
|
- uses: ./.github/workflows/sccache-probe
|
|
- uses: taiki-e/install-action@cargo-make
|
|
- run: cargo make format-check
|
|
|
|
check_docs:
|
|
timeout-minutes: 30
|
|
name: Checking docs
|
|
needs: pick-runner
|
|
runs-on: ${{ fromJSON(needs.pick-runner.outputs.overflow_6) }}
|
|
# runs-on: [self-hosted, linux, X64]
|
|
env:
|
|
RUSTC_WRAPPER: "sccache"
|
|
SCCACHE_GHA_ENABLED: "on"
|
|
RUSTDOCFLAGS: --cfg docsrs
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly-2025-10-09
|
|
- name: Install sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.11
|
|
continue-on-error: true
|
|
- uses: ./.github/workflows/sccache-probe
|
|
|
|
- name: Docs
|
|
run: cargo doc --workspace --all-features --no-deps --document-private-items
|
|
|
|
clippy_check:
|
|
timeout-minutes: 30
|
|
needs: pick-runner
|
|
runs-on: ${{ fromJSON(needs.pick-runner.outputs.overflow_7) }}
|
|
# runs-on: [self-hosted, linux, X64]
|
|
env:
|
|
RUSTC_WRAPPER: "sccache"
|
|
SCCACHE_GHA_ENABLED: "on"
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
- name: Install sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.11
|
|
continue-on-error: true
|
|
- uses: ./.github/workflows/sccache-probe
|
|
|
|
# TODO: We have a bunch of platform-dependent code so should
|
|
# probably run this job on the full platform matrix
|
|
- name: clippy check (all features)
|
|
run: cargo clippy --workspace --all-features --all-targets --lib --bins --tests --benches --examples
|
|
|
|
- name: clippy check (no features)
|
|
run: cargo clippy --workspace --no-default-features --all-targets --lib --bins --tests --benches --examples
|
|
|
|
- name: clippy check (default features)
|
|
run: cargo clippy --workspace --all-targets --lib --bins --tests --benches --examples
|
|
|
|
check_optional_deps:
|
|
timeout-minutes: 10
|
|
name: Check optional deps are absent without features
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Verify optional deps are absent without features
|
|
run: |
|
|
fail=0
|
|
for dep in portmapper igd-next swarm-discovery ring aws-lc-rs; do
|
|
echo "cargo tree -p iroh --no-default-features --edges normal --target all -i $dep";
|
|
output=$(cargo tree -p iroh --no-default-features --edges normal --target all -i "$dep" 2>&1) || true
|
|
if ! echo "$output" | grep -qE "(nothing to print|did not match any packages)"; then
|
|
echo "ERROR: $dep should not be in the dependency tree without its feature"
|
|
echo "$output"
|
|
fail=1
|
|
fi
|
|
done
|
|
exit $fail
|
|
|
|
msrv:
|
|
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')"
|
|
timeout-minutes: 30
|
|
name: Minimal Supported Rust Version
|
|
needs: pick-runner
|
|
runs-on: ${{ fromJSON(needs.pick-runner.outputs.overflow_8) }}
|
|
# runs-on: [self-hosted, linux, X64]
|
|
env:
|
|
RUSTC_WRAPPER: "sccache"
|
|
SCCACHE_GHA_ENABLED: "on"
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ env.MSRV }}
|
|
- name: Install sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.11
|
|
continue-on-error: true
|
|
- uses: ./.github/workflows/sccache-probe
|
|
|
|
- name: Check MSRV all features
|
|
run: |
|
|
cargo +$MSRV check --workspace --all-targets
|
|
|
|
cargo_deny:
|
|
timeout-minutes: 30
|
|
name: cargo deny
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: EmbarkStudios/cargo-deny-action@v2
|
|
with:
|
|
arguments: --workspace --all-features
|
|
command: check
|
|
command-arguments: "-Dwarnings"
|
|
|
|
netsim-integration-tests:
|
|
permissions: write-all
|
|
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')"
|
|
uses: "./.github/workflows/netsim_runner.yaml"
|
|
secrets: inherit
|
|
with:
|
|
branch: ${{ github.ref }}
|
|
max_workers: 6
|
|
netsim_branch: "main"
|
|
sim_paths: ${{ github.event_name == 'pull_request' && 'sims/integration' || 'sims/iroh/iroh.json,sims/integration' }}
|
|
pr_number: ${{ github.event.pull_request.number || '' }}
|
|
filter: ${{ github.event_name == 'pull_request' && 'skip:intg_iroh_full__1_to_3,intg_iroh_full__1_to_1x3,intg_iroh_relay_only__1_to_3' || '' }}
|
|
|
|
codespell:
|
|
timeout-minutes: 30
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Cache pip
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: pip-codespell-2.4.1
|
|
- run: pip install --user codespell[toml]==2.4.1
|
|
- run: codespell --ignore-words-list=ans,atmost,crate,inout,ratatui,ser,stayin,swarmin,worl,keep-alives --skip=CHANGELOG.md
|