Skip to content

Github Actions #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jul 10, 2025
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 146 additions & 0 deletions .github/workflows/simulation-bridge-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Simulation Bridge CI

on:
pull_request:
paths:
- "simulation_bridge/**"
- ".github/workflows/simulation-bridge-ci.yml"

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
env:
POETRY_HOME: ${{ runner.temp }}/poetry
run: |
python -m pip install --upgrade pip
curl -sSL https://install.python-poetry.org | python -

- name: Add Poetry to PATH
run: echo "${{ runner.temp }}/poetry/bin" >> $GITHUB_PATH

- name: Install dev dependencies
run: poetry install --with dev

- name: Check formatting (non-blocking)
run: poetry run autopep8 --recursive --diff simulation_bridge

lint:
needs: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
env:
POETRY_HOME: ${{ runner.temp }}/poetry
run: |
python -m pip install --upgrade pip
curl -sSL https://install.python-poetry.org | python -

- name: Add Poetry to PATH
run: echo "${{ runner.temp }}/poetry/bin" >> $GITHUB_PATH

- name: Install dev dependencies
run: poetry install --with dev

- name: Run pylint (min score 8.0)
run: poetry run pylint simulation_bridge --fail-under=8

# ───── 3. Tests (matrix) – coverage solo su Ubuntu ─────
test:
needs: lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
env:
POETRY_HOME: ${{ runner.temp }}/poetry
run: |
python -m pip install --upgrade pip
curl -sSL https://install.python-poetry.org | python -

- name: Add Poetry to PATH (Linux/macOS)
if: runner.os != 'Windows'
run: echo "${{ runner.temp }}/poetry/bin" >> $GITHUB_PATH

- name: Add Poetry to PATH (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: echo "${{ runner.temp }}\poetry\bin" |
Out-File -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Install dev dependencies
run: poetry install --with dev

- name: Run pytest with coverage (Ubuntu)
if: runner.os == 'Linux'
run: poetry run pytest

- name: Upload coverage to Codecov (Ubuntu)
if: runner.os == 'Linux'
uses: codecov/codecov-action@v5
with:
files: coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Run pytest (no coverage)
if: runner.os != 'Linux'
run: poetry run pytest -q

build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
env:
POETRY_HOME: ${{ runner.temp }}/poetry
run: |
python -m pip install --upgrade pip
curl -sSL https://install.python-poetry.org | python -

- name: Add Poetry to PATH
run: echo "${{ runner.temp }}/poetry/bin" >> $GITHUB_PATH

- name: Install runtime dependencies
run: poetry install --only main

- name: Build wheel and sdist
run: |
poetry build --format wheel
poetry build --format sdist

- name: Upload dist artefacts
uses: actions/upload-artifact@v4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remember to set expiration time of one hour for the artifacts.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One hour isn’t supported, so the shortest possible setting is 1 day

with:
name: simulation-bridge-dist
path: |
dist/*.whl
dist/*.tar.gz
45 changes: 0 additions & 45 deletions .github/workflows/simulation-bridge-tests.yml

This file was deleted.

1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[pytest]
testpaths = simulation_bridge/test/
addopts = --cov=simulation_bridge --cov-branch --cov-report=xml:coverage.xml