Bump pypa/gh-action-pypi-publish from 1.8.14 to 1.9.0 #1360
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: Linting | |
on: | |
push: | |
branches: | |
- main | |
- master | |
- dev | |
pull_request: | |
schedule: | |
- cron: "0 0 * * *" | |
env: | |
DEFAULT_PYTHON: 3.11 | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
name: Pre-commit | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
- name: Upgrade pip | |
run: | | |
pip install --constraint=.github/workflows/constraints.txt pip | |
pip --version | |
- name: Install Python modules | |
run: | | |
pip install --constraint=.github/workflows/constraints.txt pre-commit black flake8 reorder-python-imports poetry pytest pytest-asyncio pytest-cov aiohttp async_timeout yarl xmltodict numpy cachetools backoff aresponses | |
- name: Run pre-commit on all files | |
run: | | |
pre-commit run --all-files --show-diff-on-failure --color=always | |
pytest: | |
name: Python ${{ matrix.python }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.10", "3.11"] | |
steps: | |
- name: ⤵️ Check out code from GitHub | |
uses: actions/checkout@v4 | |
- name: 🏗 Set up Python ${{ matrix.python }} | |
id: python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: 🏗 Get pip cache dir | |
id: pip-cache | |
run: | | |
echo "::set-output name=dir::$(pip cache dir)" | |
- name: ⤵️ Restore cached Python PIP packages | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: pip-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
pip-${{ steps.python.outputs.python-version }}- | |
- name: 🏗 Install workflow dependencies | |
run: | | |
pip install -r requirements.txt | |
poetry config virtualenvs.create true | |
poetry config virtualenvs.in-project true | |
- name: ⤵️ Restore cached Python virtual environment | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('poetry.lock') }} | |
restore-keys: | | |
venv-${{ runner.os }}-${{ steps.python.outputs.python-version }}- | |
- name: 🏗 Install dependencies | |
run: poetry install --no-interaction | |
- name: 🚀 Run pytest | |
run: poetry run pytest --cov cybro tests | |
- name: ⬆️ Upload coverage artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-${{ matrix.python }} | |
path: .coverage | |
coverage: | |
runs-on: ubuntu-latest | |
needs: pytest | |
steps: | |
- name: ⤵️ Check out code from GitHub | |
uses: actions/checkout@v4 | |
- name: ⬇️ Download coverage data | |
uses: actions/download-artifact@v3 | |
- name: 🏗 Set up Python 3.11 | |
id: python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: 🏗 Get pip cache dir | |
id: pip-cache | |
run: | | |
echo "::set-output name=dir::$(pip cache dir)" | |
- name: ⤵️ Restore cached Python PIP packages | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: pip-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
pip-${{ steps.python.outputs.python-version }}- | |
- name: 🏗 Install workflow dependencies | |
run: | | |
pip install -r requirements.txt | |
poetry config virtualenvs.create true | |
poetry config virtualenvs.in-project true | |
- name: ⤵️ Restore cached Python virtual environment | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: >- | |
venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('poetry.lock') }} | |
venv-${{ steps.python.outputs.python-version }}- | |
- name: 🏗 Install dependencies | |
run: poetry install --no-interaction | |
- name: 🚀 Process coverage results | |
run: | | |
poetry run coverage combine coverage*/.coverage* | |
poetry run coverage xml -i | |
- name: 🚀 Upload coverage report | |
uses: codecov/codecov-action@v4 |