Add Titanic example and improve optional type to be usable with str t… #164
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] | |
| jobs: | |
| pre-commit: | |
| name: Run pre-commit on all files | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" | |
| - name: Load cached Poetry installation | |
| id: cached-poetry | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.local | |
| key: poetry-0 | |
| - name: Install Poetry | |
| if: steps.cached-poetry.outputs.cache-hit != 'true' | |
| uses: snok/install-poetry@v1 | |
| - name: Install package including dev dependencies using Poetry | |
| run: poetry install | |
| - name: Run pre-commit on all files | |
| run: poetry run pre-commit run --all-files | |
| pytest: | |
| name: Run unit-tests using pytest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" | |
| - name: Load cached Poetry installation | |
| id: cached-poetry | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.local | |
| key: poetry-0 | |
| - name: Install Poetry | |
| if: steps.cached-poetry.outputs.cache-hit != 'true' | |
| uses: snok/install-poetry@v1 | |
| - name: Install package including dev dependencies using Poetry | |
| run: poetry install | |
| - name: Run pytest tests | |
| run: poetry run pytest tests |