Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
237 changes: 117 additions & 120 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
pull_request:
types: [ 'labeled', 'unlabeled', 'opened', 'synchronize', 'reopened' ]
types: ["labeled", "unlabeled", "opened", "synchronize", "reopened"]
merge_group:
push:
branches:
Expand All @@ -24,7 +24,7 @@ jobs:
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'
uses: "./.github/workflows/tests.yaml"

cross_build:
name: Cross Build Only
Expand All @@ -35,8 +35,8 @@ jobs:
fail-fast: false
matrix:
target:
# cross tests are currently broken vor armv7 and aarch64
# see https://github.com/cross-rs/cross/issues/1311
# 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
Expand All @@ -45,29 +45,29 @@ jobs:
# Netbsd execution fails to link in cross
# - x86_64-unknown-netbsd
steps:
- name: Checkout
uses: actions/checkout@v5
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
- 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'}}
- name: Checkout
uses: actions/checkout@v5
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
- 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'}}

android_build:
name: Android Build Only
Expand All @@ -82,38 +82,38 @@ jobs:
- aarch64-linux-android
- armv7-linux-androideabi
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- name: Install rustup target
run: rustup target add ${{ 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@v3

- name: Setup Android NDK
uses: arqu/setup-ndk@main
id: setup-ndk
with:
ndk-version: r23
add-to-path: true

- name: Build
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
cargo install --version 3.5.4 cargo-ndk
cargo ndk --target ${{ matrix.target }} build
- name: Checkout
uses: actions/checkout@v5

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- name: Install rustup target
run: rustup target add ${{ 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@v3

- name: Setup Android NDK
uses: arqu/setup-ndk@main
id: setup-ndk
with:
ndk-version: r23
add-to-path: true

- name: Build
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
cargo install --version 3.5.4 cargo-ndk
cargo ndk --target ${{ matrix.target }} build

cross_test:
name: Cross Test
Expand All @@ -126,26 +126,26 @@ jobs:
target:
- i686-unknown-linux-gnu
steps:
- name: Checkout
uses: actions/checkout@v5
with:
submodules: recursive
- name: Checkout
uses: actions/checkout@v5
with:
submodules: recursive

- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install rust stable
uses: dtolnay/rust-toolchain@stable

- name: Cleanup Docker
continue-on-error: true
run: |
docker kill $(docker ps -q)
- name: Cleanup Docker
continue-on-error: true
run: |
docker kill $(docker ps -q)

# See https://github.com/cross-rs/cross/issues/1222
- uses: taiki-e/install-action@cross
# See https://github.com/cross-rs/cross/issues/1222
- 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' }}
- name: test
run: cross test --all --target ${{ matrix.target }} -- --test-threads=12
env:
RUST_LOG: ${{ runner.debug && 'TRACE' || 'DEBUG' }}

check_semver:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -185,13 +185,13 @@ jobs:
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "on"
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: taiki-e/install-action@cargo-make
- run: cargo make format-check
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: taiki-e/install-action@cargo-make
- run: cargo make format-check

check_docs:
timeout-minutes: 30
Expand All @@ -201,17 +201,17 @@ jobs:
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "on"
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-02-20
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.9

- name: Docs
run: cargo doc --workspace --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: --cfg docsrs
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-02-20
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.9

- name: Docs
run: cargo doc --workspace --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: --cfg docsrs

clippy_check:
timeout-minutes: 30
Expand All @@ -220,23 +220,20 @@ jobs:
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "on"
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.9

# 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 --bins --tests --benches
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.9

- name: clippy check (no features)
run: cargo clippy --workspace --no-default-features --lib --bins --tests
# 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 --bins --tests --benches

- name: clippy check (default features)
run: cargo clippy --workspace --all-targets
- name: clippy check (default features)
run: cargo clippy --workspace --all-targets

msrv:
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')"
Expand All @@ -247,16 +244,16 @@ jobs:
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "on"
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.9
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.9

- name: Check MSRV all features
run: |
cargo +$MSRV check --workspace --all-targets
- name: Check MSRV all features
run: |
cargo +$MSRV check --workspace --all-targets

cargo_deny:
timeout-minutes: 30
Expand All @@ -274,6 +271,6 @@ jobs:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- run: pip install --user codespell[toml]
- run: codespell --ignore-words-list=ans,atmost,crate,inout,ratatui,ser,stayin,swarmin,worl --skip=CHANGELOG.md
- uses: actions/checkout@v5
- run: pip install --user codespell[toml]
- run: codespell --ignore-words-list=ans,atmost,crate,inout,ratatui,ser,stayin,swarmin,worl --skip=CHANGELOG.md
48 changes: 48 additions & 0 deletions .github/workflows/wasm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: wasm

on:
pull_request:
types: ["labeled", "unlabeled", "opened", "synchronize", "reopened"]
merge_group:
push:
branches:
- main

jobs:
wasm_check:
name: Build & check wasm32 for browsers
runs-on: ubuntu-latest
env:
RUSTFLAGS: '--cfg getrandom_backend="wasm_js"'
steps:
- name: Checkout sources
uses: actions/checkout@v5

- name: Setup node.js version 22.5 # needed for browser-like websocket API support in node.js
uses: actions/setup-node@v6
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 cargo-binstall
uses: cargo-bins/cargo-binstall@main

- name: Install wasm-bindgen-test-runner
run: cargo binstall wasm-bindgen-cli --locked --no-confirm

- name: Install wasm-tools
uses: bytecodealliance/actions/wasm-tools/setup@v1

- name: wasm32 build
run: cargo build --target wasm32-unknown-unknown --no-default-features

# 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 Wasm
run: |
! wasm-tools print --skeleton target/wasm32-unknown-unknown/debug/iroh_n0des.wasm | grep 'import "env"'
Loading
Loading