Skip to content

Commit ae4c6cc

Browse files
Tianyu Songstytim
authored andcommitted
Add GitHub Actions CI for macOS
Two jobs run on every push/PR against main and dev: - C++ build + tests: brew installs wxwidgets and libarchive, configures CMake with BUILD_TESTS=ON, builds all four targets, runs ./build/mrtk_tests, uploads mrtk_cli and mrtk_gui as artifacts (14-day retention). - Python tests: installs pytest, requests, packaging on Python 3.12 and runs pytest against tests/test_core_logic.py.
1 parent 35efaf9 commit ae4c6cc

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
9+
jobs:
10+
cpp-build-and-test:
11+
name: C++ build + tests (macOS)
12+
runs-on: macos-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install build dependencies (Homebrew)
17+
run: |
18+
brew update
19+
brew install wxwidgets libarchive
20+
21+
- name: Configure CMake
22+
run: cmake -S . -B build -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release
23+
24+
- name: Build (mrtk_core, mrtk_cli, mrtk_gui, mrtk_tests)
25+
run: cmake --build build -j
26+
27+
- name: Run regression tests
28+
run: ./build/mrtk_tests
29+
30+
- name: Upload built binaries
31+
if: always()
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: mrtk-macos-${{ github.sha }}
35+
path: |
36+
build/mrtk_cli
37+
build/mrtk_gui
38+
if-no-files-found: warn
39+
retention-days: 14
40+
41+
python-tests:
42+
name: Python tests (macOS)
43+
runs-on: macos-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- uses: actions/setup-python@v5
48+
with:
49+
python-version: "3.12"
50+
51+
- name: Install Python dependencies
52+
run: |
53+
python -m pip install --upgrade pip
54+
pip install pytest requests packaging
55+
56+
- name: Run pytest
57+
run: python -m pytest tests/test_core_logic.py -v

0 commit comments

Comments
 (0)