docs #317
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: Tests | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
test: | |
name: ${{ matrix.os }} / ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
matrix: | |
os: [Ubuntu, MacOS, Windows] | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
continue-on-error: ${{ matrix.python-version == '' }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get full Python version | |
id: full-python-version | |
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-monaco-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: | | |
poetry config installer.max-workers 1 | |
poetry install --extras "pandas" --no-root | |
- name: Install library | |
run: poetry install --extras "pandas" | |
- name: Activate Environment | |
run: source $VENV | |
- name: Run tests and coverage | |
run: | | |
poetry run coverage run --source=monaco -m pytest | |
poetry run coverage report -m | |
poetry run coverage xml | |
poetry run coverage html | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
path: htmlcov |