change CI to include uv installation #593
This file contains 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: testing | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4.3.0 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
cache-dependency-path: "pyproject.toml" | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install uv | |
uv venv | |
python --version | |
uv pip install --upgrade ruff mypy | |
- name: ruff | |
run: | | |
ruff --version | |
ruff check | |
- name: mypy | |
run: | | |
mypy --version | |
rm -rf .mypy_cache | |
mypy src/rxn_network | |
test: | |
strategy: | |
max-parallel: 6 | |
matrix: | |
os: [ubuntu-latest] | |
python_version: ["3.9", "3.10", "3.11"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python_version }} | |
uses: actions/setup-python@v4.3.0 | |
with: | |
python-version: ${{ matrix.python_version }} | |
cache: "pip" | |
cache-dependency-path: "pyproject.toml" | |
- name: Install python dependencies | |
run: | | |
pip install --upgrade pip | |
pip install uv | |
uv pip install -e .[strict,tests] | |
- name: Test with pytest | |
env: | |
MP_API_KEY: ${{ secrets.MP_API_KEY }} | |
run: | | |
pytest --cov=src/rxn_network --cov-report=xml | |
- uses: codecov/codecov-action@v3.1.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install pandoc | |
run: sudo apt-get install pandoc | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4.3.0 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
cache-dependency-path: "pyproject.toml" | |
- name: Install python dependencies | |
run: | | |
pip install --upgrade pip | |
pip install uv | |
uv pip install -e .[strict,docs] | |
- name: Build | |
run: sphinx-build docs docs_build |