Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
feat: add new structure for more languages
  • Loading branch information
mathusanm6 committed Oct 27, 2024
commit ac267ee4d56f39930808132c93c86414d57ac349
53 changes: 27 additions & 26 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
name: Python CI (conda)
name: Python Lint & Test

on: [push]

jobs:
build-linux:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
conda update -n base -c defaults conda
- name: Lint with flake8
run: |
conda install -y flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
conda install -y pytest
pytest
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install dependencies
run: |
python -m pip install -upgrade pip
pip install -r python/requirements.txt

- name: Lint code with Ruff
run: ruff check python --output-format=github --target-version=py39

- name: Check code formatting with Ruff
run: ruff format python --diff --target-version=py39
continue-on-error: true

- name: Test with pytest
run: |
pip install pytest pytest-cov
pytest python --doctest-modules --junitxml=junit/test-results.xml --cov=python --cov-report=xml --cov-report=html
3 changes: 3 additions & 0 deletions .gitignore → python/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Environment
*_env/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions python/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Upgrade pip to avoid compatibility issues
pip>=21.0

# Linting and formatting tools
ruff

# Testing tools
pytest
pytest-cov
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading