Skip to content

Commit

Permalink
Try to fix uncommitted docs check
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli committed Mar 6, 2025
1 parent 54da0e7 commit 71fa65d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 60 deletions.
70 changes: 18 additions & 52 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,42 @@
name: Tests
on: [push, pull_request]
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:

jobs:
build:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.8"
plone-version: "5.2"
- python-version: "3.9"
plone-version: "6.0"
- python-version: "3.10"
plone-version: "6.0"
- python-version: "3.11"
plone-version: "6.0"
- python-version: "3.12"
plone-version: "6.0"
- python-version: "3.10"
plone-version: "6.1"
- python-version: "3.11"
plone-version: "6.1"
- python-version: "3.12"
plone-version: "6.1"
- python-version: "3.13"
plone-version: "6.2"
steps:
# git checkout
- uses: actions/checkout@v4

# python setup
# Python setup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

# buildout eggs cache
- uses: actions/cache@v3
with:
path: eggs
key: ${{ runner.os }}-py${{ matrix.python-version }}-plone${{ matrix.plone-version }}-${{ hashFiles('*.cfg') }}
restore-keys: |
${{ runner.os }}-py${{ matrix.python-version }}-plone${{ matrix.plone-version }}-
${{ runner.os }}-py${{ matrix.python-version }}-
# python install
- run: pip install virtualenv
- run: pip install wheel
- name: pip install
run: pip install -r requirements-${{ matrix.plone-version }}.txt

# buildout
- name: buildout
run: if [ "${{ matrix.plone-version }}" == "6.0" ] && [ ${{ matrix.python-version }} == '3.8' ]; then buildout -t 10 -c plone-6.0.x-python3.8.cfg; else buildout -t 10 -c plone-${{ matrix.plone-version }}.x.cfg; fi;
env:
CI: true

# build sphinx
- name: sphinx
run: if [ "${{ matrix.plone-version }}" == "6.0" ] && [ ${{ matrix.python-version }} == '3.12' ]; then make docs-html; fi

# test
- name: test
run: bin/test
# Run tests
- name: Install dependencies
run: make test

# test no uncommitted changes
- name: test no uncommitted changes
run: ./test-no-uncommitted-doc-changes
env:
PYTHON_VERSION: ${{ matrix.python-version }}
PLONE_VERSION: ${{ matrix.plone-version }}

# test for broken links
- name: linkcheck
run: if [ "${{ matrix.plone-version }}" == "6.0" ] && [ ${{ matrix.python-version }} == '3.12' ]; then make docs-linkcheckbroken; fi
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ exclude Makefile
exclude CODEOWNERS
exclude docs/make.bat
exclude .python-version
exclude constraints-mxdev.txt
exclude requirements-mxdev.txt
recursive-exclude docs/doctrees *
recursive-exclude docs/html *
recursive-exclude performance *
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ instance/etc/zope.ini: $(BIN_FOLDER)/pipx ## Create instance configuration
@echo "$(GREEN)==> Create instance configuration$(RESET)"
$(BIN_FOLDER)/pipx run cookiecutter -f --no-input --config-file instance.yaml gh:plone/cookiecutter-zope-instance

$(BIN_FOLDER)/runwsgi: ## Install Plone
@echo "$(CREEN)==> Install Plone$(RESET)"
$(BIN_FOLDER)/runwsgi $(BIN_FOLDER)/zope-testrunner: ## Install Plone
@echo "$(GREEN)==> Install Plone$(RESET)"
$(BIN_FOLDER)/mxdev -c mx.ini
$(BIN_FOLDER)/pip install -r requirements-mxdev.txt

Expand All @@ -114,8 +114,8 @@ check: $(BIN_FOLDER)/tox ## Check and fix code base according to Plone standards
$(BIN_FOLDER)/tox -e lint

.PHONY: test
test: $(BIN_FOLDER)/tox ## Run tests
$(BIN_FOLDER)/tox -e test
test: $(BIN_FOLDER)/zope-testrunner ## Run tests
$(BIN_FOLDER)/zope-testrunner --all --test-path=src -s plone.restapi

## Performance tests (need to be updated)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-c constraints.txt
Plone
plone.restapi[test]
6 changes: 3 additions & 3 deletions test-no-uncommitted-doc-changes
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ function red {
echo "$RED $1 $RESET"
}

if [ "$PLONE_VERSION" == "6.0" ] && [ "$PYTHON_VERSION" == '3.12' ]; then
echo "Running check for undocumented changes for Plone 6.0.x on Python 3.12"
if [ "$PLONE_VERSION" == "6.2" ] && [ "$PYTHON_VERSION" == '3.13' ]; then
echo "Running check for undocumented changes for Plone 6.2.x on Python 3.13"
else
# request/response dumps have known differences for different Python/Plone combinations
# => skip, we can't have the Plone 5 build fail because of those
echo "Skipping checks for undocumented changes for everything except Plone 6.0.x on Python 3.12"
echo "Skipping checks for undocumented changes for everything except Plone 6.2.x on Python 3.13"
echo "PLONE_VERSION=$PLONE_VERSION"
echo "PYTHON_VERSION=$PYTHON_VERSION"
exit 0
Expand Down

0 comments on commit 71fa65d

Please sign in to comment.