212134 #63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Build and Test | |
| on: | |
| push: | |
| branches: [ trunk, main ] | |
| pull_request: | |
| branches: [ trunk, main ] | |
| jobs: | |
| security-audit: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| checks: write | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Run Security Audit | |
| uses: rustsec/audit-check@v2.0.0 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| working-directory: plug.app/rt | |
| test-rust: | |
| name: Rust Unit Tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Cache Rust Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: plug.app/rt | |
| - name: Run Cargo Tests | |
| working-directory: plug.app/rt | |
| run: cargo test --target ${{ matrix.target }} | |
| build-windows: | |
| name: Build plug (Windows) | |
| runs-on: windows-latest | |
| needs: test-rust | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown, x86_64-pc-windows-msvc | |
| - name: Set up MSVC & Developer Command Prompt | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Set up CMake & Ninja | |
| uses: lukka/get-cmake@latest | |
| - name: Build Rust Static Library | |
| working-directory: plug.app/rt | |
| run: cargo build --release --lib --target x86_64-pc-windows-msvc | |
| - name: Build WASM Plugins | |
| shell: bash | |
| run: | | |
| mkdir -p plugins | |
| rustc --target wasm32-unknown-unknown --crate-type cdylib plug.app/rt/src_plugins/pTerm/pTerm.rs -o plugins/pTerm.wasm -C opt-level=z -C lto=true -C link-arg=--allow-undefined | |
| cp plug.app/rt/src_plugins/plugin.toml plugins/plugin.toml | |
| - name: Run CMake Configuration | |
| shell: bash | |
| run: | | |
| cmake -G Ninja \ | |
| -S plug.cross/windows \ | |
| -B plug.cross/windows/build \ | |
| "-DRUST_LIB_PATH=${{ github.workspace }}/plug.app/rt/target/x86_64-pc-windows-msvc/release/tm_main.lib" \ | |
| -DCOMPILE_RUST_CORE=OFF \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DHIDE_CONSOLE=ON \ | |
| -DPLUG_ENABLE_HEADLESS_MODE=OFF | |
| - name: Compile plug executable | |
| run: | | |
| cmake --build plug.cross/windows/build --config Release | |
| - name: Run Unified Test Orchestrator | |
| run: | | |
| python tests/run.py --ci | |
| build-linux: | |
| name: Build plug (Linux) | |
| runs-on: ubuntu-latest | |
| needs: test-rust | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Install GTK4 Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-4-dev pkg-config ninja-build libx11-dev xvfb | |
| - name: Build Rust Static Library | |
| working-directory: plug.app/rt | |
| run: cargo build --release --lib --target x86_64-unknown-linux-gnu | |
| - name: Build WASM Plugins | |
| run: | | |
| mkdir -p plugins | |
| rustc --target wasm32-unknown-unknown --crate-type cdylib plug.app/rt/src_plugins/pTerm/pTerm.rs -o plugins/pTerm.wasm -C opt-level=z -C lto=true -C link-arg=--allow-undefined | |
| cp plug.app/rt/src_plugins/plugin.toml plugins/plugin.toml | |
| - name: Run CMake Configuration | |
| run: | | |
| cmake -G Ninja -S plug.cross/linux -B plug.cross/linux/build "-DRUST_LIB_PATH=${{ github.workspace }}/plug.app/rt/target/x86_64-unknown-linux-gnu/release/libtm_main.a" -DCMAKE_BUILD_TYPE=Release -DPLUG_ENABLE_HEADLESS_MODE=ON | |
| - name: Compile plug executable | |
| run: | | |
| cmake --build plug.cross/linux/build | |
| - name: Run Unified Test Orchestrator | |
| run: | | |
| GDK_BACKEND=x11 xvfb-run --auto-servernum python tests/run.py --ci | |