|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
| 11 | +env: |
| 12 | + OPENSSL_PACKAGE_VERSION: 3.0.2-0ubuntu1.25 |
| 13 | + UBUNTU_SNAPSHOT: 20260702T000000Z |
| 14 | + |
| 15 | +jobs: |
| 16 | + crypto-pinned: |
| 17 | + runs-on: ubuntu-22.04 |
| 18 | + timeout-minutes: 15 |
| 19 | + container: |
| 20 | + image: ubuntu:22.04@sha256:0d779ea97881505f5ef0039336ee85edba27519bdba968c284c86ee066a973c8 |
| 21 | + defaults: |
| 22 | + run: |
| 23 | + shell: bash |
| 24 | + steps: |
| 25 | + - name: Bootstrap certificate trust |
| 26 | + run: | |
| 27 | + apt-get update -o APT::Update::Error-Mode=any |
| 28 | + DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \ |
| 29 | + ca-certificates |
| 30 | +
|
| 31 | + - name: Install dependencies from the pinned Ubuntu snapshot |
| 32 | + run: | |
| 33 | + printf '%s\n' \ |
| 34 | + "deb [snapshot=${UBUNTU_SNAPSHOT}] http://archive.ubuntu.com/ubuntu jammy main" \ |
| 35 | + "deb [snapshot=${UBUNTU_SNAPSHOT}] http://archive.ubuntu.com/ubuntu jammy-updates main" \ |
| 36 | + "deb [snapshot=${UBUNTU_SNAPSHOT}] http://security.ubuntu.com/ubuntu jammy-security main" \ |
| 37 | + > /etc/apt/sources.list |
| 38 | + apt-get update -o APT::Update::Error-Mode=any |
| 39 | + DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \ |
| 40 | + build-essential \ |
| 41 | + ca-certificates \ |
| 42 | + curl \ |
| 43 | + git \ |
| 44 | + "libssl3=${OPENSSL_PACKAGE_VERSION}" \ |
| 45 | + "libssl-dev=${OPENSSL_PACKAGE_VERSION}" \ |
| 46 | + "openssl=${OPENSSL_PACKAGE_VERSION}" |
| 47 | +
|
| 48 | + - uses: actions/checkout@v5 |
| 49 | + |
| 50 | + - name: Install MoonBit |
| 51 | + run: | |
| 52 | + curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash |
| 53 | + echo "$HOME/.moon/bin" >> "$GITHUB_PATH" |
| 54 | +
|
| 55 | + - name: Verify and record the exact crypto build identity |
| 56 | + run: | |
| 57 | + test "$(dpkg-query -W -f='${Version}' openssl)" = "$OPENSSL_PACKAGE_VERSION" |
| 58 | + test "$(dpkg-query -W -f='${Version}' libssl3)" = "$OPENSSL_PACKAGE_VERSION" |
| 59 | + test "$(dpkg-query -W -f='${Version}' libssl-dev)" = "$OPENSSL_PACKAGE_VERSION" |
| 60 | + dpkg-query -W openssl libssl3 libssl-dev | tee openssl-packages.txt |
| 61 | + openssl version -a | tee openssl-version.txt |
| 62 | + moon version --all |
| 63 | +
|
| 64 | + - name: Resolve MoonBit dependencies |
| 65 | + run: moon update |
| 66 | + |
| 67 | + - name: Check and test against the pinned OpenSSL build |
| 68 | + run: | |
| 69 | + moon check --target native --warn-list +73 |
| 70 | + moon test --target native |
| 71 | +
|
| 72 | + - name: Archive pinned OpenSSL build identity |
| 73 | + if: always() |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: openssl-build-identity |
| 77 | + path: | |
| 78 | + openssl-packages.txt |
| 79 | + openssl-version.txt |
| 80 | + if-no-files-found: error |
| 81 | + |
| 82 | + native: |
| 83 | + runs-on: ubuntu-22.04 |
| 84 | + timeout-minutes: 15 |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@v5 |
| 87 | + |
| 88 | + - name: Check out pinned Rust oracle |
| 89 | + uses: actions/checkout@v5 |
| 90 | + with: |
| 91 | + repository: webrtc-rs/rtc |
| 92 | + ref: a10cd2c18f7c4e646e83f6f00b792ef38ac3cdb2 |
| 93 | + path: upstream/rtc |
| 94 | + |
| 95 | + - name: Install native dependencies |
| 96 | + run: | |
| 97 | + sudo apt-get update |
| 98 | + sudo apt-get install --yes build-essential libssl-dev |
| 99 | +
|
| 100 | + - name: Install MoonBit |
| 101 | + run: | |
| 102 | + curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash |
| 103 | + echo "$HOME/.moon/bin" >> "$GITHUB_PATH" |
| 104 | +
|
| 105 | + - name: Verify toolchain and OpenSSL |
| 106 | + run: | |
| 107 | + moon version --all |
| 108 | + openssl version -a | tee openssl-version.txt |
| 109 | + openssl version | grep -E '^OpenSSL 3\.' |
| 110 | +
|
| 111 | + - name: Resolve MoonBit dependencies |
| 112 | + run: moon update |
| 113 | + |
| 114 | + - name: Install pinned Node |
| 115 | + uses: actions/setup-node@v4 |
| 116 | + with: |
| 117 | + node-version: 24.3.0 |
| 118 | + cache: npm |
| 119 | + cache-dependency-path: interop/chromium/package-lock.json |
| 120 | + |
| 121 | + - name: Verify upstream inventory |
| 122 | + run: | |
| 123 | + scripts/audit-upstream.mjs \ |
| 124 | + --upstream upstream/rtc \ |
| 125 | + --write-ledger docs/upstream-coverage.json |
| 126 | + git diff --exit-code -- docs/upstream-coverage.json |
| 127 | +
|
| 128 | + - name: Check formatting |
| 129 | + run: moon fmt --check |
| 130 | + |
| 131 | + - name: Strict C shim compile |
| 132 | + run: | |
| 133 | + cc -std=c11 -Wall -Wextra -Werror \ |
| 134 | + -I"$HOME/.moon/include" \ |
| 135 | + -fsyntax-only internal/crypto/openssl_shim.c |
| 136 | + cc -std=c11 -Wall -Wextra -Werror \ |
| 137 | + -I"$HOME/.moon/include" \ |
| 138 | + -fsyntax-only runtime/async/clock.c |
| 139 | +
|
| 140 | + - name: Typecheck native packages |
| 141 | + run: moon check --target native --warn-list +73 |
| 142 | + |
| 143 | + - name: Run native and documentation tests |
| 144 | + run: moon test --target native |
| 145 | + |
| 146 | + - name: Build native release benchmarks |
| 147 | + run: moon bench --release --target native --no-parallelize --build-only |
| 148 | + |
| 149 | + - name: Build fixed Rust interoperability peer |
| 150 | + run: | |
| 151 | + rustc --version | grep -F 'rustc 1.90.0' |
| 152 | + cargo build --locked --manifest-path interop/rust-peer/Cargo.toml |
| 153 | +
|
| 154 | + - name: Run Rust DataChannel and audio/video interoperability in both roles |
| 155 | + run: scripts/test-rust-interop |
| 156 | + |
| 157 | + - name: Install pinned Playwright and Chromium revision |
| 158 | + working-directory: interop/chromium |
| 159 | + run: | |
| 160 | + npm ci |
| 161 | + npx playwright install --with-deps chromium |
| 162 | +
|
| 163 | + - name: Run Chromium DataChannel and audio/video interoperability in both roles |
| 164 | + run: scripts/test-chromium-interop |
| 165 | + |
| 166 | + - name: Run DataChannel through digest-pinned coturn |
| 167 | + run: scripts/test-coturn-interop |
| 168 | + |
| 169 | + - name: Archive coturn log |
| 170 | + if: always() |
| 171 | + uses: actions/upload-artifact@v4 |
| 172 | + with: |
| 173 | + name: coturn-log |
| 174 | + path: ${{ runner.temp }}/rtc-mbt-coturn.log |
| 175 | + if-no-files-found: ignore |
| 176 | + |
| 177 | + - name: Verify generated public interfaces |
| 178 | + run: | |
| 179 | + moon info |
| 180 | + test -z "$(git status --porcelain -- '*.mbti')" |
| 181 | + git diff --exit-code -- '*.mbti' |
| 182 | +
|
| 183 | + - name: Archive OpenSSL build identity |
| 184 | + uses: actions/upload-artifact@v4 |
| 185 | + with: |
| 186 | + name: openssl-host-version |
| 187 | + path: openssl-version.txt |
| 188 | + |
| 189 | + asan: |
| 190 | + runs-on: ubuntu-22.04 |
| 191 | + timeout-minutes: 20 |
| 192 | + steps: |
| 193 | + - uses: actions/checkout@v5 |
| 194 | + |
| 195 | + - name: Install pinned Node |
| 196 | + uses: actions/setup-node@v4 |
| 197 | + with: |
| 198 | + node-version: 24.3.0 |
| 199 | + |
| 200 | + - name: Install native dependencies |
| 201 | + run: | |
| 202 | + sudo apt-get update |
| 203 | + sudo apt-get install --yes build-essential libasan8 libssl-dev |
| 204 | +
|
| 205 | + - name: Install MoonBit |
| 206 | + run: | |
| 207 | + curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash |
| 208 | + echo "$HOME/.moon/bin" >> "$GITHUB_PATH" |
| 209 | +
|
| 210 | + - name: Resolve MoonBit dependencies |
| 211 | + run: moon update |
| 212 | + |
| 213 | + - name: Run C stubs and native test entries under ASan |
| 214 | + run: scripts/run-asan.mjs |
0 commit comments