Skip to content

Merge pull request #141 from exonet/dependabot/github_actions/patches… #343

Merge pull request #141 from exonet/dependabot/github_actions/patches…

Merge pull request #141 from exonet/dependabot/github_actions/patches… #343

Workflow file for this run

---
name: Testing
on:
push:
pull_request:
workflow_dispatch:
jobs:
pytest:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set pip cache dir
id: pip-cache
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Restore cached Python pip packages
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}-${{ hashFiles('.github/workflows/requirements.txt') }}
restore-keys: |
pip-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}-
- name: Install Poetry 1.5.1
if: ${{ matrix.python-version == '3.7' }}
uses: snok/install-poetry@93ada01c735cc8a383ce0ce2ae205a21c415379b #1.3.4
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install workflow dependencies
if: ${{ matrix.python-version != '3.7' }}
run: |
pip install -r .github/workflows/requirements.txt
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Restore cached Python venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: >-
venv-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
venv-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}-
- name: Install dependencies
run: poetry install --no-interaction
- name: Run pytest
run: poetry run pytest --cov certbot_dns_exonet tests
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: .coverage
coverage:
runs-on: ubuntu-latest
needs: pytest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download coverage data
uses: actions/download-artifact@v4
- name: Set up Python 3.11
id: python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Set pip cache dir
id: pip-cache
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Restore cached Python pip packages
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}-${{ hashFiles('.github/workflows/requirements.txt') }}
restore-keys: |
pip-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}-
- name: Install workflow dependencies
run: |
pip install -r .github/workflows/requirements.txt
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Restore cached Python venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: >-
venv-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
venv-${{ runner.os }}-v3-${{ 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@5ecb98a3c6b747ed38dc09f787459979aebb39be #4.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}