Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
39 changes: 39 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

name: POSM Pipeline CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip'

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install ruff pytest
# pip install -r requirements.txt (Uncomment when you add this file)

- name: Lint and Format with Ruff
run: |
# Fails the build if there are syntax errors or undefined names
ruff check .
# Fails the build if the code is not formatted properly
ruff format --check .

- name: Run Unit Tests
run: |
pytest tests/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt .

RUN pip install --upgrade pip && \
pip install -r requirements.txt

COPY . .

CMD ["python", "scripts/run_pipeline.py"]
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[tool.ruff]
# Set the maximum line length
line-length = 100
# Assume Python 3.11
target-version = "py311"

[tool.ruff.lint]
# E: pycodestyle errors, F: Pyflakes (syntax errors), I: isort (import sorting)
select = ["E", "F", "I"]

[tool.pytest.ini_options]
# Define where the test suite lives
testpaths = ["tests"]
# Add detailed output to the test logs
addopts = "-v"
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ruff
pytest
Empty file added scripts/run_pipeline.py
Empty file.
Binary file not shown.
6 changes: 6 additions & 0 deletions tests/mock_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def test_placeholder():
"""
A temporary placeholder test to ensure the GitHub Actions CI pipeline
runs successfully. Real pipeline tests will be added here later.
"""
assert True