Feat/add prefect #315
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: pre-commit & unit tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.13' | |
| - name: Install poetry | |
| run: | | |
| python -m pip install poetry | |
| poetry self add poetry-plugin-export | |
| poetry export --with dev --format=requirements.txt --output=requirements.txt | |
| - name: set PY | |
| run: echo "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
| - uses: pre-commit/[email protected] | |
| - name: Install python dependencies | |
| run: | | |
| poetry install --no-interaction | |
| - name: Activate environment | |
| run: | | |
| poetry env activate | |
| - name: Execute unit tests | |
| run: | | |
| poetry run pytest -v | |
| - name: Verify tests results | |
| if: ${{ failure() }} | |
| run: exit 1 |