CI #55
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
workflow_dispatch: | |
schedule: | |
- cron: '33 7 * * 0' # run weekly on sundays | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- "3.12" | |
- "3.11" | |
- "3.10" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install "poetry" | |
python -m poetry self add poetry-version-plugin | |
- name: Remove poetry config | |
run: rm -f poetry.toml | |
- name: Configure poetry | |
run: python -m poetry config virtualenvs.create false | |
- name: Install Dependencies | |
run: python -m poetry install --with dev | |
- name: Lint | |
run: | | |
python -m poetry run flake8 asyncstatsd | |
python -m poetry run mypy . | |
- name: Test | |
run: python -m poetry run pytest | |
env: | |
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }} |