[brief] Adds unit tests to prove the restart logic of the trainer. #17
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: [ master ] | |
paths-ignore: | |
- 'README.md' | |
- '.pre-commit-config.yaml' | |
- 'data/**' | |
- "LICENSE" | |
pull_request: | |
branches: [ master ] | |
paths-ignore: | |
- 'README.md' | |
- 'LICENSE' | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
id: setup_python | |
with: | |
python-version: "3.11" | |
- name: Cache virtualenv | |
uses: actions/cache@v3 | |
with: | |
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('requirements/ci.txt') }} | |
path: venv | |
- name: Install dependencies | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
python -m pip install -r requirements/ci.txt | |
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH | |
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV | |
- name: Install Pyro | |
shell: bash | |
run: | | |
pip install . | |
ruff check src/pyro | |
- name: Ruff | |
run: | | |
ruff check src/pyro | |
ruff check test | |
- name: Mypy | |
run: | | |
mypy src/pyro | |
mypy test | |
- name: Pytest | |
run: | | |
python -m pytest |