Skip to content

Commit 22217ed

Browse files
fangqclaude
andcommitted
[test] add unit test suite and GitHub Actions CI
Adds test/test_redbird.m (numeric/string/cell/struct/predicate comparison harness with rel+abs tolerance) and test/run_redbird_test.m covering 87 tests across 7 groups: util, jac, prop, mesh, forward, solver, recon. Each group is independently selectable and the mesh/forward/recon groups are auto-skipped if iso2mesh is unavailable. Adds .github/workflows/run_test.yml mirroring jsonlab's workflow: matrix Octave (ubuntu/macOS/windows) and MATLAB (R2022a, ubuntu/macOS/ windows) jobs. Each job shallow-clones iso2mesh and jsonlab as runtime dependencies before invoking the test driver. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 5ce2913 commit 22217ed

3 files changed

Lines changed: 813 additions & 0 deletions

File tree

.github/workflows/run_test.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Redbird CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
octave_test:
7+
name: Octave tests
8+
strategy:
9+
fail-fast: false
10+
# provided octave versions: ubuntu-22.04 = 6.4, ubuntu-24.04 = 8.4, macos-15-intel = 10.3, windows-2022 = 10.3
11+
matrix:
12+
os: [ubuntu-22.04, ubuntu-24.04, macos-15-intel, windows-2022]
13+
runs-on: ${{ matrix.os }}
14+
defaults:
15+
run:
16+
shell: bash
17+
18+
steps:
19+
- name: Checkout redbird
20+
uses: actions/checkout@v3
21+
with:
22+
submodules: 'recursive'
23+
path: redbird
24+
- name: Clone runtime dependencies (iso2mesh, jsonlab)
25+
run: |
26+
git clone --depth 1 https://github.com/fangq/iso2mesh.git iso2mesh
27+
git clone --depth 1 https://github.com/fangq/jsonlab.git jsonlab
28+
- name: Install Octave
29+
run: |
30+
if [[ "$RUNNER_OS" == "Linux" ]]; then
31+
sudo apt-get update && sudo apt-get install -y octave
32+
elif [[ "$RUNNER_OS" == "macOS" ]]; then
33+
brew install octave
34+
elif [[ "$RUNNER_OS" == "Windows" ]]; then
35+
curl --retry 3 -kL http://cdimage.debian.org/mirror/gnu.org/gnu/octave/windows/octave-10.3.0-w64-64.7z --output octave_10.3.0.7z
36+
7z x octave_10.3.0.7z -ooctave -y
37+
echo "$PWD/octave/octave-10.3.0-w64-64/mingw64/bin" >> $GITHUB_PATH
38+
echo "JAVA_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
39+
fi
40+
- name: Run tests
41+
run: |
42+
octave-cli --version
43+
octave-cli --eval "addpath(genpath('iso2mesh')); addpath('jsonlab'); cd redbird/test; run_redbird_test"
44+
45+
matlab_test:
46+
name: MATLAB tests
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
os: [ubuntu-22.04, macos-15-intel, macos-14, windows-2022]
51+
runs-on: ${{ matrix.os }}
52+
steps:
53+
- name: Checkout redbird
54+
uses: actions/checkout@v3
55+
with:
56+
submodules: 'recursive'
57+
path: redbird
58+
- name: Clone runtime dependencies (iso2mesh, jsonlab)
59+
shell: bash
60+
run: |
61+
git clone --depth 1 https://github.com/fangq/iso2mesh.git iso2mesh
62+
git clone --depth 1 https://github.com/fangq/jsonlab.git jsonlab
63+
- name: Set up MATLAB
64+
uses: matlab-actions/setup-matlab@v2
65+
with:
66+
release: R2022a
67+
- name: Run MATLAB tests
68+
uses: matlab-actions/run-command@v2
69+
with:
70+
command: addpath(genpath('iso2mesh')); addpath('jsonlab'); cd redbird/test; run_redbird_test

0 commit comments

Comments
 (0)