Skip to content

Commit 3b9ecdc

Browse files
authored
Add Github Actions (#27)
1 parent 3bb3805 commit 3b9ecdc

File tree

4 files changed

+192
-45
lines changed

4 files changed

+192
-45
lines changed

.github/workflows/matlab-agent-ci.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: MATLAB Agent CI
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "agents/matlab/**"
7+
- ".github/workflows/matlab-agent-ci.yml"
8+
9+
jobs:
10+
ci:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
16+
# All commands run inside the agent directory
17+
defaults:
18+
run:
19+
working-directory: agents/matlab
20+
21+
steps:
22+
# ───── 1. Checkout ─────
23+
- uses: actions/checkout@v4
24+
25+
# ───── 2. Python + Poetry ─────
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.12"
29+
30+
- name: Install Poetry
31+
env:
32+
POETRY_HOME: ${{ runner.temp }}/poetry
33+
run: |
34+
python -m pip install --upgrade pip
35+
curl -sSL https://install.python-poetry.org | python -
36+
37+
- name: Add Poetry to PATH (Linux/macOS)
38+
if: runner.os != 'Windows'
39+
run: echo "${{ runner.temp }}/poetry/bin" >> $GITHUB_PATH
40+
41+
- name: Add Poetry to PATH (Windows)
42+
if: runner.os == 'Windows'
43+
shell: pwsh
44+
run: echo "${{ runner.temp }}\poetry\bin" |
45+
Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
46+
47+
# ───── 3. Install dev deps once ─────
48+
- name: Install dev dependencies
49+
run: poetry install --with dev
50+
51+
# ───── 4. Format check (non-blocking, Linux only) ─────
52+
- name: Check formatting (non-blocking)
53+
if: matrix.os == 'ubuntu-latest'
54+
continue-on-error: true
55+
run: poetry run autopep8 --recursive --diff matlab_agent
56+
57+
# ───── 5. Lint (Linux only) ─────
58+
- name: Run pylint (min score 8.0)
59+
if: matrix.os == 'ubuntu-latest'
60+
run: poetry run pylint matlab_agent --fail-under=8
61+
62+
# ───── 6. Tests ─────
63+
# - name: Run pytest with coverage (Linux)
64+
# if: matrix.os == 'ubuntu-latest'
65+
# run: poetry run pytest
66+
67+
# - name: Upload coverage to Codecov
68+
# if: matrix.os == 'ubuntu-latest'
69+
# uses: codecov/codecov-action@v5
70+
# with:
71+
# files: coverage.xml
72+
# fail_ci_if_error: true
73+
# token: ${{ secrets.CODECOV_TOKEN }}
74+
75+
# - name: Run pytest (no coverage)
76+
# if: matrix.os != 'ubuntu-latest'
77+
# run: poetry run pytest -q
78+
79+
# ───── 7. Build + dist artefacts (Linux only) ─────
80+
- name: Install runtime dependencies
81+
if: matrix.os == 'ubuntu-latest'
82+
run: poetry install --only main
83+
84+
- name: Build wheel and sdist
85+
if: matrix.os == 'ubuntu-latest'
86+
run: |
87+
poetry build --format wheel
88+
poetry build --format sdist
89+
90+
- name: Upload dist artefacts
91+
if: matrix.os == 'ubuntu-latest'
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: matlab-agent-dist
95+
path: |
96+
agents/matlab/dist/*.whl
97+
agents/matlab/dist/*.tar.gz
98+
retention-days: 1 # minimum allowed (≈24 h)
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Simulation Bridge CI
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "simulation_bridge/**"
7+
- ".github/workflows/simulation-bridge-ci.yml"
8+
9+
jobs:
10+
ci:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
16+
steps:
17+
# ───── 1. Checkout ─────
18+
- uses: actions/checkout@v4
19+
20+
# ───── 2. Python + Poetry ─────
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.12"
24+
25+
- name: Install Poetry
26+
env:
27+
POETRY_HOME: ${{ runner.temp }}/poetry
28+
run: |
29+
python -m pip install --upgrade pip
30+
curl -sSL https://install.python-poetry.org | python -
31+
32+
- name: Add Poetry to PATH (Linux/macOS)
33+
if: runner.os != 'Windows'
34+
run: echo "${{ runner.temp }}/poetry/bin" >> $GITHUB_PATH
35+
36+
- name: Add Poetry to PATH (Windows)
37+
if: runner.os == 'Windows'
38+
shell: pwsh
39+
run: echo "${{ runner.temp }}\poetry\bin" |
40+
Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
41+
42+
# ───── 3. Install deps once ─────
43+
- name: Install dev dependencies
44+
run: poetry install --with dev
45+
46+
# ───── 4. Format (non-blocking, Linux only) ─────
47+
- name: Check formatting (non-blocking)
48+
if: matrix.os == 'ubuntu-latest'
49+
continue-on-error: true
50+
run: poetry run autopep8 --recursive --diff simulation_bridge
51+
52+
# ───── 5. Lint (Linux only) ─────
53+
- name: Run pylint (min score 8.0)
54+
if: matrix.os == 'ubuntu-latest'
55+
run: poetry run pylint simulation_bridge --fail-under=8
56+
57+
# ───── 6. Tests ─────
58+
- name: Run pytest with coverage (Linux)
59+
if: matrix.os == 'ubuntu-latest'
60+
run: poetry run pytest
61+
62+
- name: Upload coverage to Codecov
63+
if: matrix.os == 'ubuntu-latest'
64+
uses: codecov/codecov-action@v5
65+
with:
66+
files: coverage.xml
67+
fail_ci_if_error: true
68+
token: ${{ secrets.CODECOV_TOKEN }}
69+
70+
- name: Run pytest (no coverage)
71+
if: matrix.os != 'ubuntu-latest'
72+
run: poetry run pytest -q
73+
74+
# ───── 7. Build + dist artefacts (Linux only) ─────
75+
- name: Install runtime dependencies
76+
if: matrix.os == 'ubuntu-latest'
77+
run: poetry install --only main
78+
79+
- name: Build wheel and sdist
80+
if: matrix.os == 'ubuntu-latest'
81+
run: |
82+
poetry build --format wheel
83+
poetry build --format sdist
84+
85+
- name: Upload dist artefacts
86+
if: matrix.os == 'ubuntu-latest'
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: simulation-bridge-dist
90+
path: |
91+
dist/*.whl
92+
dist/*.tar.gz
93+
retention-days: 1

.github/workflows/simulation-bridge-tests.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[pytest]
22
testpaths = simulation_bridge/test/
3+
addopts = --cov=simulation_bridge --cov-branch --cov-report=xml:coverage.xml

0 commit comments

Comments
 (0)