Update documentation #140
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: Tests | |
on: | |
push: | |
branches: | |
- master # Trigger on pushes to the main branch | |
- development # Trigger on pushes to the development branch | |
pull_request: | |
branches: | |
- master # Trigger on pull requests to the main branch | |
- development # Trigger on pull requests to the development branch | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ['3.11', '3.12'] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} # Specify the Python version | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
# Cache Poetry dependencies and virtual environment to speed up builds | |
- name: Cache Poetry dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pypoetry | |
~/.virtualenvs | |
key: poetry-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
poetry-${{ runner.os }}-${{ matrix.python-version }}- | |
# Report whether the cache was hit or missed | |
- name: Report cache usage | |
run: | | |
if [ "${{ steps.cache.outputs.cache-hit }}" = "true" ]; then | |
echo "Poetry cache was HIT." | |
else | |
echo "Poetry cache was MISSED. Dependencies will be freshly installed." | |
fi | |
# Install dependencies listed in pyproject.toml using Poetry | |
- name: Install dependencies using Poetry | |
run: | | |
poetry install | |
# Run your test suite using Poetry's virtual environment | |
- name: Run tests | |
run: | | |
poetry run python -m unittest discover tests "test_*.py" |