Skip to content

WebACMEClient

WebACMEClient #20

Workflow file for this run

name: Run Tests
env:
PIP_CACHE_DIR: .pip
PYTHONPATH: src
on:
push:
paths:
- ".github/workflows/py-tests.yml"
- "pyproject.toml"
- ".requirements/*.txt"
- "examples/**"
- "src/**"
- "tests/**"
branches:
- master
pull_request:
branches:
- master
release:
types: ["published"]
jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: true
matrix:
# Run on all supported versions
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set Up Python {{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Cache dependencies
- name: Cache Dependencies
uses: actions/cache@v3
with:
path: ./.pip
key: ${{ runner.os }}-tests-{{ matrix.python-version }}-${{ hashFiles('./.requirements/lint.txt') }}-${{ hashFiles('./.requirements/test.txt') }}
- name: Upgrade Pip
run: python -m pip install --upgrade pip
- name: Upgrade Build
run: pip install --upgrade build
- name: Install Dependencies
run: pip install -IU -r ./.requirements/deps.txt -r ./.requirements/lint.txt -r ./.requirements/test.txt
- name: Check Formatting
run: black --check examples/ src/ tests/
- name: Check Ruff
run: ruff -q examples/ src/ tests/
- name: Check Mypy
run: mypy --strict src/
- name: Run Tests
run: coverage run -m pytest -v
env:
CI_ACME_TEST_DOMAIN: ${{ secrets.CI_ACME_TEST_DOMAIN }}
CI_ACME_TEST_USER: ${{ secrets.CI_ACME_TEST_USER }}
CI_ACME_TEST_PASS: ${{ secrets.CI_ACME_TEST_PASS }}
- name: Coverage Report
run: coverage report
publish:
runs-on: ubuntu-20.04
needs: test
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set Up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Upgrade Pip
run: python -m pip install --upgrade pip
- name: Upgrade Build
run: pip install --upgrade build
- name: Build Package
run: python -m build --sdist --wheel
# - name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}