Files
noq/.github/workflows/iroh-patchbay.yml
Floris Bruynooghe 99ad1cc0c7 chore: Upgrade async-executor and allow warnings in patchbay build (#888)
## Description

- There was a use-after-fee regression in 1.14 that means it was yanked
which made cargo-deny unhappy.

- patchbay failed to build because noq main has deprecated an API that
iroh uses. But we don't actually care about build warnings of iroh in
noq. Allow them.

## API Changes

n/a

## Notes & open questions

n/a

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All API changes documented.
- [x] `cargo make` passes locally.
2026-11-04 15:48:46 +00:00

126 lines
4.8 KiB
YAML

name: iroh-patchbay
on:
pull_request:
merge_group:
push:
branches:
- main
concurrency:
group: iroh-patchbay-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
RUST_BACKTRACE: 1
SCCACHE_CACHE_SIZE: "10G"
IROH_FORCE_STAGING_RELAYS: "1"
NEXTEST_VERSION: "0.9.80"
# Default to read-only; jobs that need more grant it explicitly.
permissions:
contents: read
jobs:
iroh_patchbay:
name: iroh patchbay
timeout-minutes: 30
runs-on: [self-hosted, linux, X64]
env:
RUSTC_WRAPPER: "sccache"
steps:
- name: Enable unprivileged user namespaces
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
continue-on-error: true
- name: Checkout noq
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
path: noq
persist-credentials: false
- name: Checkout iroh
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
repository: n0-computer/iroh
ref: main
path: iroh
persist-credentials: false
- uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # v1
with:
toolchain: stable
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- name: Install cargo-make and cargo-nextest
uses: taiki-e/install-action@b20dedce73af6905cdc30d6611090c9b67557c8d # v2.85.12
with:
tool: nextest@${{ env.NEXTEST_VERSION }},cargo-make
- name: Patch noq crates in iroh workspace
working-directory: iroh
run: |
# Delete any pre-existing trailing patch section. This
# assumes the patch section is trailing and the only reason
# there would be any patch is because of noq. Could be
# smarter.
mv Cargo.toml Cargo.toml.in
awk 'BEGIN { in_patch = 0 }; /\[patch\.crates-io\]/ { in_patch = 1 }; !in_patch { print }' Cargo.toml.in > Cargo.toml
# Add our own patch section.
cat >> Cargo.toml <<'EOF'
[patch.crates-io]
noq = { path = "../noq/noq" }
noq-proto = { path = "../noq/noq-proto" }
noq-udp = { path = "../noq/noq-udp" }
EOF
# Patch the version numbers. Note because the output of
# cargo-metadata is JSON, these variables will include the
# quotes around the version numbers.
NOQ_VERSION=$(cargo metadata --manifest-path=../noq/Cargo.toml --format-version=1 --no-deps | jq '.packages[] | select(.name == "noq") | .version')
NOQ_PROTO_VERSION=$(cargo metadata --manifest-path=../noq/Cargo.toml --format-version=1 --no-deps | jq '.packages[] | select(.name == "noq-proto") | .version')
NOQ_UDP_VERSION=$(cargo metadata --manifest-path=../noq/Cargo.toml --format-version=1 --no-deps | jq '.packages[] | select(.name == "noq-udp") | .version')
echo noq version: $NOQ_VERSION
echo noq-proto version: $NOQ_PROTO_VERSION
echo noq-udp version: $NOQ_UDP_VERSION
sed -i -E "/^noq .*version/s/(version += +)\"[0-9.]+\"/\1 $NOQ_VERSION/" iroh/Cargo.toml
sed -i -E "/^noq .*version/s/(version += +)\"[0-9.]+\"/\1 $NOQ_VERSION/" iroh-relay/Cargo.toml
sed -i -E "/^noq-proto .*version/s/(version += +)\"[0-9.]+\"/\1 $NOQ_PROTO_VERSION/" iroh/Cargo.toml
sed -i -E "/^noq-proto .*version/s/(version += +)\"[0-9.]+\"/\1 $NOQ_PROTO_VERSION/" iroh-relay/Cargo.toml
sed -i -E "/^noq-udp .*version/s/(version += +)\"[0-9.]+\"/\1 $NOQ_UDP_VERSION/" iroh/Cargo.toml
sed -i -E "/^noq-udp .*version/s/(version += +)\"[0-9.]+\"/\1 $NOQ_UDP_VERSION/" iroh-relay/Cargo.toml
sed -i -E "/^noq = \"[0-9.]+\"/s/\"[0-9.]+\"/$NOQ_VERSION/" iroh/bench/Cargo.toml
# No --locked: patching iroh to this checkout regenerates iroh's
# lockfile. Pinning there is the iroh repo's job.
- name: Build patchbay tests
working-directory: iroh
run: cargo make patchbay --no-run
env:
RUSTFLAGS: "-Awarnings"
- name: Run patchbay tests
working-directory: iroh
run: |
set -o pipefail
cargo make patchbay 2>&1 | tee "$RUNNER_TEMP/logs.txt"
env:
RUSTFLAGS: "-Awarnings"
PATCHBAY_LOG: ${{ runner.debug && 'trace' || 'debug' }}
RUST_LOG: ${{ runner.debug && 'trace' || 'debug' }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: iroh-patchbay-testdir-${{ github.sha }}
path: |
iroh/target/testdir-*/
${{ runner.temp }}/logs.txt
retention-days: 7
if-no-files-found: ignore