CI pipeline #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: opencosmo CI | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint-typecheck: | |
name: Lint and Type Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Poetry | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
- name: Install dependencies | |
run: poetry install --with develop | |
- name: Run ruff linter | |
run: poetry run ruff check . | |
- name: Run mypy type checker | |
run: poetry run mypy . | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.11', '3.12', '3.13'] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
- uses: snok/install-poetry@v1 | |
- name: Install dependencies | |
run: poetry install --with test | |
- name: Run tests with pytest | |
run: poetry run pytest |