Back to development: 2.0.0rc4 #13
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: pas.plugins.authomatic CI | |
on: | |
push: | |
env: | |
PYTHON_VERSION: "3.12" | |
PLONE_VERSION: "6.1.1" | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
name: "Lint codebase" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
enable-cache: true | |
- name: Check formatting | |
if: ${{ success() || failure() }} | |
id: ruff-format | |
run: uvx ruff@latest format --diff | |
- name: Check lint | |
if: ${{ success() || failure() }} | |
id: ruff-lint | |
run: uvx ruff@latest check --diff | |
- name: Check XML / ZCML | |
if: ${{ success() || failure() }} | |
id: zpretty | |
run: uvx zpretty@latest --check src | |
- name: Check Package Metadata | |
if: ${{ success() || failure() }} | |
id: pyroma | |
run: uvx pyroma@latest -d . | |
- name: Check Python Versions | |
if: ${{ success() || failure() }} | |
id: py-versions | |
run: uvx check-python-versions@latest . | |
- name: Report | |
if: ${{ success() || failure() }} | |
run: | | |
echo '# Code Analysis' >> $GITHUB_STEP_SUMMARY | |
echo '| Test | Status |' >> $GITHUB_STEP_SUMMARY | |
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY | |
echo '| Format | ${{ steps.ruff-format.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY | |
echo '| Lint | ${{ steps.ruff-lint.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY | |
echo '| XML / ZCML | ${{ steps.zpretty.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY | |
echo '| Package Metadata | ${{ steps.pyroma.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY | |
echo '| Python Versions | ${{ steps.py-versions.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.10', '3.11', '3.12', '3.13'] | |
plone-version: ['6.1-latest', '6.0-latest'] | |
env: | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
PLONE_VERSION: ${{ matrix.plone-version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
enable-cache: false | |
- name: Restore uv cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.UV_CACHE_DIR }} | |
key: uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}-${{ hashFiles('pyproject.toml') }} | |
restore-keys: | | |
uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}-${{ hashFiles('pyproject.toml') }} | |
uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }} | |
- name: Install Plone and package | |
run: make install | |
- name: Run tests | |
run: make test | |
coverage: | |
runs-on: ubuntu-latest | |
name: "Test Coverage" | |
needs: | |
- test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
enable-cache: false | |
- name: Restore uv cache | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/.uv-cache | |
key: uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}-${{ hashFiles('pyproject.toml') }} | |
restore-keys: | | |
uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}-${{ hashFiles('pyproject.toml') }} | |
uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }} | |
- name: Install Plone and package | |
run: make install | |
- name: Run tests | |
run: make test-coverage | |
- name: Report Coverage | |
run: | | |
echo "# Coverage Report" >> $GITHUB_STEP_SUMMARY | |
echo "$(uv run coverage report --format markdown)" >> $GITHUB_STEP_SUMMARY | |
report: | |
runs-on: ubuntu-latest | |
needs: | |
- lint | |
- test | |
- coverage | |
steps: | |
- name: Report | |
shell: bash | |
run: | | |
echo '# Report' >> $GITHUB_STEP_SUMMARY | |
echo '| Job | Status |' >> $GITHUB_STEP_SUMMARY | |
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY | |
echo '| Lint | ✅ |' >> $GITHUB_STEP_SUMMARY | |
echo '| Test | ✅ |' >> $GITHUB_STEP_SUMMARY | |
echo '| Coverage | ✅ |' >> $GITHUB_STEP_SUMMARY |