mirror of
https://github.com/Devolutions/IronRDP.git
synced 2026-11-23 00:14:10 +00:00
0eb2d9d6b7
Add browser playback of recorded RDP sessions through a protocol-agnostic Svelte player, an RDP WASM backend, and a demo with local-file and HTTP range data sources. Consumers provide the recordings; this does not add a recording mechanism. Replay requires post-decryption Fast-Path captures. The HTTP demo validates its index and bounds range requests and playback fetches. --------- Co-authored-by: Marc-André Moreau <mamoreau@devolutions.net> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
402 lines
12 KiB
YAML
402 lines
12 KiB
YAML
name: CI
|
||
|
||
on:
|
||
push:
|
||
branches:
|
||
- master
|
||
pull_request:
|
||
types: [opened, synchronize, reopened]
|
||
workflow_dispatch:
|
||
|
||
concurrency:
|
||
# Stacked PRs get two `synchronize` events per push (base and head branch), and a new push makes
|
||
# the previous run obsolete: keep only the latest run per PR. Other events never share a group.
|
||
group: ci-${{ github.event.pull_request.number || github.run_id }}
|
||
cancel-in-progress: true
|
||
|
||
env:
|
||
# Disable incremental compilation. CI builds are often closer to from-scratch builds, as changes
|
||
# are typically bigger than from a local edit-compile cycle.
|
||
# Incremental compilation also significantly increases the amount of IO and the size of ./target
|
||
# folder, which makes caching less effective.
|
||
CARGO_INCREMENTAL: 0
|
||
CARGO_NET_RETRY: 10
|
||
RUSTUP_MAX_RETRIES: 10
|
||
RUST_BACKTRACE: short
|
||
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
|
||
# Cache should never takes more than a few seconds to get downloaded.
|
||
# If it does, let’s just rebuild from scratch instead of hanging "forever".
|
||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
|
||
# Disabling debug info so compilation is faster and ./target folder is smaller.
|
||
CARGO_PROFILE_DEV_DEBUG: 0
|
||
|
||
jobs:
|
||
formatting:
|
||
name: Check formatting
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- uses: actions/checkout@v6
|
||
|
||
- name: Check formatting
|
||
run: cargo xtask check fmt -v
|
||
|
||
test-settings:
|
||
name: Check test settings
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- uses: actions/checkout@v6
|
||
with:
|
||
# PR checkout uses a merge commit; depth 2 includes its base parent as HEAD^1.
|
||
fetch-depth: 2
|
||
|
||
- name: Check protected settings
|
||
if: github.event_name == 'pull_request'
|
||
run: cargo xtask check test-settings --base 'HEAD^1' --head 'HEAD' -v
|
||
|
||
typos:
|
||
name: Check typos
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- uses: actions/checkout@v6
|
||
|
||
- name: Binary cache
|
||
uses: actions/cache@v5
|
||
with:
|
||
path: ./.cargo/local_root/bin
|
||
key: ${{ runner.os }}-bin-${{ github.job }}-${{ hashFiles('xtask/src/bin_version.rs') }}
|
||
|
||
- name: typos (prepare)
|
||
run: cargo xtask check install -v
|
||
|
||
- name: typos (check)
|
||
run: cargo xtask check typos -v
|
||
|
||
# release-binaries.yml cannot use the shared action (it checks out the release tag), so it
|
||
# carries a copy that must stay identical.
|
||
- name: Inlined prune step matches shared action
|
||
run: |
|
||
shared="$(yq '.runs.steps[] | select(.name == "Uninstall unpinned Rust toolchains") | .run' .github/actions/prune-rust-toolchains/action.yml)"
|
||
release="$(yq '.jobs.build.steps[] | select(.name == "Prune Rust toolchains") | .run' .github/workflows/release-binaries.yml)"
|
||
test -n "$shared"
|
||
diff -u <(echo "$shared") <(echo "$release")
|
||
|
||
# TODO: Move this action to a dedicated repository.
|
||
openai-agent:
|
||
name: OpenAI agent action [${{ matrix.os }}]
|
||
runs-on: ${{ matrix.os }}
|
||
strategy:
|
||
fail-fast: false
|
||
matrix:
|
||
os: [ubuntu-latest, windows-latest]
|
||
|
||
steps:
|
||
- uses: actions/checkout@v6
|
||
|
||
- name: Install dependencies
|
||
working-directory: .github/actions/openai-agent
|
||
run: npm ci
|
||
|
||
- name: Test PR automation
|
||
run: node --test .github/pr-automation/automation.test.js
|
||
|
||
- name: Run tests
|
||
working-directory: .github/actions/openai-agent
|
||
run: npm test
|
||
|
||
- name: Build action
|
||
working-directory: .github/actions/openai-agent
|
||
run: npm run build
|
||
|
||
- name: Verify bundled action
|
||
working-directory: .github/actions/openai-agent
|
||
run: git diff --exit-code -- dist
|
||
|
||
checks:
|
||
name: Checks [${{ matrix.os }}]
|
||
runs-on: ${{ matrix.runner }}
|
||
strategy:
|
||
fail-fast: false
|
||
matrix:
|
||
os: [windows, linux, macos]
|
||
include:
|
||
- os: windows
|
||
runner: windows-latest
|
||
- os: linux
|
||
runner: ubuntu-latest
|
||
- os: macos
|
||
runner: macos-latest
|
||
|
||
steps:
|
||
- name: Checkout
|
||
uses: actions/checkout@v6
|
||
|
||
- name: Install build dependencies
|
||
uses: ./.github/actions/install-build-deps
|
||
|
||
- name: Prune Rust toolchains
|
||
uses: ./.github/actions/prune-rust-toolchains
|
||
|
||
- name: Rust cache
|
||
uses: Swatinem/rust-cache@v2.9.1
|
||
with:
|
||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||
|
||
- name: Binary cache
|
||
uses: actions/cache@v5
|
||
with:
|
||
path: ./.cargo/local_root/bin
|
||
key: ${{ runner.os }}-bin-${{ github.job }}-${{ hashFiles('xtask/src/bin_version.rs') }}
|
||
|
||
# Compilation is separated from execution so we know exactly the time for each step.
|
||
|
||
- name: Tests (compile)
|
||
run: cargo xtask check tests --no-run -v
|
||
|
||
- name: Tests (run)
|
||
run: cargo xtask check tests -v
|
||
|
||
- name: Build ActiveX host harness
|
||
if: matrix.os == 'windows'
|
||
run: dotnet build .\crates\ironrdp-activex\tests\ironrdp-axhost\IronRdpAxHost.csproj --configuration Release
|
||
|
||
- name: Lints
|
||
run: cargo xtask check lints -v
|
||
|
||
- name: Dependencies
|
||
run: cargo xtask check dependencies -v
|
||
|
||
- name: Packet captures
|
||
run: cargo xtask check captures -v
|
||
|
||
- name: WASM (prepare)
|
||
run: cargo xtask wasm install -v
|
||
|
||
- name: WASM (check)
|
||
run: cargo xtask wasm check -v
|
||
|
||
- name: Lock files
|
||
run: cargo xtask check locks -v
|
||
|
||
fuzz:
|
||
name: Fuzzing
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- uses: actions/checkout@v6
|
||
|
||
- name: Prune Rust toolchains
|
||
uses: ./.github/actions/prune-rust-toolchains
|
||
|
||
- name: Rust cache
|
||
uses: Swatinem/rust-cache@v2.9.1
|
||
with:
|
||
workspaces: fuzz -> target
|
||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||
|
||
- name: Binary cache
|
||
uses: actions/cache@v5
|
||
with:
|
||
path: ./.cargo/local_root/bin
|
||
key: ${{ runner.os }}-bin-${{ github.job }}-${{ hashFiles('xtask/src/bin_version.rs') }}
|
||
|
||
- name: Prepare
|
||
run: cargo xtask fuzz install -v
|
||
|
||
# Simply run all fuzz targets for a few seconds, just checking there is nothing obviously wrong at a quick glance
|
||
- name: Fuzz
|
||
run: cargo xtask fuzz run -v
|
||
|
||
- name: Lock files
|
||
run: cargo xtask check locks -v
|
||
|
||
web:
|
||
name: Web Client
|
||
runs-on: ubuntu-24.04
|
||
|
||
steps:
|
||
- uses: actions/checkout@v6
|
||
|
||
- name: Prune Rust toolchains
|
||
uses: ./.github/actions/prune-rust-toolchains
|
||
|
||
- name: Rust cache
|
||
uses: Swatinem/rust-cache@v2.9.1
|
||
with:
|
||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||
|
||
- name: Binary cache
|
||
uses: actions/cache@v5
|
||
with:
|
||
path: ./.cargo/local_root/bin
|
||
key: ${{ runner.os }}-bin-${{ github.job }}-${{ hashFiles('xtask/src/bin_version.rs') }}
|
||
|
||
- name: Prepare
|
||
run: cargo xtask web install -v
|
||
|
||
- name: Prepare replay web packages
|
||
run: cargo xtask web install-replay -v
|
||
|
||
- name: Check
|
||
run: cargo xtask web check -v
|
||
|
||
- name: Install replay browser
|
||
run: npx playwright install --with-deps chromium
|
||
working-directory: web-client/iron-replay-player
|
||
|
||
- name: Check replay web packages
|
||
run: cargo xtask web check-replay -v
|
||
|
||
- name: Check replay browser tests
|
||
run: npm run test:browser
|
||
working-directory: web-client/iron-replay-player
|
||
|
||
- name: Lock files
|
||
run: cargo xtask check locks -v
|
||
|
||
ffi:
|
||
name: FFI
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- uses: actions/checkout@v6
|
||
|
||
- name: Install native build dependencies
|
||
uses: ./.github/actions/install-build-deps
|
||
|
||
- name: Set up the pinned diplomat-tool
|
||
uses: ./.github/actions/setup-diplomat-tool
|
||
|
||
- name: Build native library
|
||
run: cargo xtask ffi build -v
|
||
|
||
- name: Run Rust FFI tests
|
||
run: cargo test --locked -p ffi --lib
|
||
|
||
- name: Generate bindings
|
||
run: cargo xtask ffi bindings -v
|
||
|
||
- name: Build .NET projects
|
||
run: cd ./ffi/dotnet && dotnet build
|
||
|
||
- name: Run .NET smoke tests
|
||
run: dotnet run --project ./ffi/dotnet/Devolutions.IronRdp.Tests --no-build
|
||
|
||
ffi-bindings-check:
|
||
name: FFI bindings reproducibility
|
||
runs-on: windows-latest
|
||
|
||
steps:
|
||
- uses: actions/checkout@v6
|
||
|
||
- name: Install native build dependencies
|
||
uses: ./.github/actions/install-build-deps
|
||
|
||
- name: Set up the pinned diplomat-tool
|
||
uses: ./.github/actions/setup-diplomat-tool
|
||
|
||
# The solution is built below, after the regenerated bindings pass the drift check.
|
||
- name: Regenerate C# bindings
|
||
run: cargo xtask ffi bindings --skip-dotnet-build -v
|
||
|
||
- name: Check generated binding drift
|
||
shell: pwsh
|
||
run: |
|
||
$paths = @(
|
||
"ffi/dotnet/Devolutions.IronRdp/Generated",
|
||
"ffi/dotnet-interop-conf.toml"
|
||
)
|
||
$changes = git status --porcelain=v1 --untracked-files=all -- $paths
|
||
if ($changes) {
|
||
[Console]::Error.WriteLine('FFI bindings are not reproducible. Regenerate them with `cargo xtask ffi install` then `cargo xtask ffi bindings` and commit the result.')
|
||
$changes
|
||
git --no-pager diff -- $paths
|
||
exit 1
|
||
}
|
||
|
||
- name: Build native library
|
||
run: cargo xtask ffi build -v
|
||
|
||
- name: Build IronRdp.sln
|
||
run: dotnet build ffi/dotnet/IronRdp.sln -c Release
|
||
|
||
- name: Run .NET smoke tests
|
||
run: dotnet run --project ffi/dotnet/Devolutions.IronRdp.Tests -c Release --no-build
|
||
|
||
feature-matrix-setup:
|
||
name: feature matrix setup
|
||
runs-on: ubuntu-latest
|
||
outputs:
|
||
feature-matrix: ${{ steps.setup-matrix.outputs.feature-matrix }}
|
||
|
||
steps:
|
||
- uses: actions/checkout@v6
|
||
|
||
- name: Prune Rust toolchains
|
||
uses: ./.github/actions/prune-rust-toolchains
|
||
|
||
- name: Rust cache
|
||
uses: Swatinem/rust-cache@v2.9.1
|
||
with:
|
||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||
|
||
- name: Setup matrix
|
||
id: setup-matrix
|
||
run: |
|
||
MATRIX="$(cargo xtask check features --list --format github-matrix)"
|
||
echo "feature-matrix=$MATRIX" >> "$GITHUB_OUTPUT"
|
||
|
||
feature-matrix:
|
||
name: feature matrix [${{ matrix.case }}]
|
||
needs: [feature-matrix-setup]
|
||
runs-on: ubuntu-latest
|
||
strategy:
|
||
fail-fast: false
|
||
matrix:
|
||
include: ${{ fromJson(needs.feature-matrix-setup.outputs.feature-matrix) }}
|
||
|
||
steps:
|
||
- uses: actions/checkout@v6
|
||
|
||
- name: Install build dependencies
|
||
uses: ./.github/actions/install-build-deps
|
||
|
||
- name: Prune Rust toolchains
|
||
uses: ./.github/actions/prune-rust-toolchains
|
||
|
||
- name: Rust cache
|
||
uses: Swatinem/rust-cache@v2.9.1
|
||
with:
|
||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||
|
||
- name: Binary cache
|
||
uses: actions/cache@v5
|
||
with:
|
||
path: ./.cargo/local_root/bin
|
||
key: ${{ runner.os }}-bin-${{ github.job }}-${{ hashFiles('xtask/src/bin_version.rs') }}
|
||
|
||
- name: Prepare
|
||
run: cargo xtask check install -v
|
||
|
||
- name: Run feature-matrix case
|
||
run: cargo xtask check features --case '${{ matrix.case }}' -v
|
||
|
||
- name: Lock files
|
||
run: cargo xtask check locks -v
|
||
|
||
success:
|
||
name: Success
|
||
if: ${{ always() }}
|
||
needs: [formatting, test-settings, typos, openai-agent, checks, fuzz, web, ffi, ffi-bindings-check, feature-matrix-setup, feature-matrix]
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- name: Check success
|
||
run: |
|
||
$results = '${{ toJSON(needs.*.result) }}' | ConvertFrom-Json
|
||
$succeeded = $($results | Where { $_ -Ne "success" }).Count -Eq 0
|
||
exit $(if ($succeeded) { 0 } else { 1 })
|
||
shell: pwsh
|