Skip to content

Commit 9e1d83c

Browse files
committed
workflows
1 parent 3bb3805 commit 9e1d83c

File tree

4 files changed

+119
-0
lines changed

4 files changed

+119
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: MATLAB Agent Tests
2+
3+
on:
4+
push:
5+
paths:
6+
- "agent/matlab/**"
7+
- ".github/workflows/matlab-agent-tests.yml"
8+
pull_request:
9+
paths:
10+
- "agent/matlab/**"
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
working-directory: agent/matlab # directory del progetto Poetry
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.10"
27+
28+
- name: Install Poetry
29+
run: |
30+
python -m pip install --upgrade pip
31+
curl -sSL https://install.python-poetry.org | python -
32+
env:
33+
POETRY_HOME: ${{ runner.temp }}/poetry
34+
- name: Add Poetry to PATH
35+
run: echo "${{ runner.temp }}/poetry/bin" >> $GITHUB_PATH
36+
37+
- name: Install dependencies (dev incluse)
38+
run: poetry install --with dev
39+
40+
- name: Run pytest (unit + integration) con coverage
41+
run: poetry run pytest
42+
43+
- name: Upload coverage to Codecov
44+
uses: codecov/codecov-action@v5
45+
with:
46+
files: coverage.xml
47+
fail_ci_if_error: true
48+
token: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Simulation Bridge Coverage
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
coverage:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- uses: actions/setup-python@v5
13+
with:
14+
python-version: "3.12"
15+
16+
- name: Install Poetry
17+
run: |
18+
python -m pip install --upgrade pip
19+
curl -sSL https://install.python-poetry.org | python -
20+
env:
21+
POETRY_HOME: ${{ runner.temp }}/poetry
22+
- run: echo "${{ runner.temp }}/poetry/bin" >> $GITHUB_PATH
23+
24+
- name: Install dependencies (dev incluse)
25+
run: poetry install --with dev
26+
27+
- name: Run tests and generate coverage.xml
28+
run: poetry run pytest
29+
30+
- name: Upload coverage to Codecov
31+
uses: codecov/codecov-action@v5
32+
with:
33+
files: coverage.xml
34+
fail_ci_if_error: true
35+
token: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Simulation Bridge Lint (pylint & autopep8)
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- uses: actions/setup-python@v5
13+
with:
14+
python-version: "3.12"
15+
16+
- name: Install Poetry
17+
run: |
18+
python -m pip install --upgrade pip
19+
curl -sSL https://install.python-poetry.org | python -
20+
env:
21+
POETRY_HOME: ${{ runner.temp }}/poetry
22+
- run: echo "${{ runner.temp }}/poetry/bin" >> $GITHUB_PATH
23+
24+
- name: Install deps
25+
run: poetry install --with dev
26+
27+
# ---------- autopep8 ----------
28+
- name: Check formatting with autopep8
29+
run: |
30+
poetry run autopep8 --recursive --diff --exit-code .
31+
32+
# ---------- pylint ----------
33+
- name: Run pylint (fail under 8.0/10)
34+
run: |
35+
poetry run pylint simulation_bridge --fail-under=8

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)