-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (118 loc) · 4.24 KB
/
Copy pathci.yml
File metadata and controls
143 lines (118 loc) · 4.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
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