Skip to content

Commit

Permalink
branch test Windows and MacOS
Browse files Browse the repository at this point in the history
- ci(python-nightly): fix ubuntu versions
- ci(branch-test-others): add branches test Windows and MacOS
- ci(test-coverage): codecov/codecov-action 4.3.0 --> 4.5.0
- test: coverage omit igor.py and setup.py and vendered packages
  • Loading branch information
msftcangoblowm committed Aug 31, 2024
1 parent 616b235 commit e3741da
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 20 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/branch-test-others.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/msftcangoblowm/sphinx-external-toc-strict/blob/main/NOTICE.txt
# For contributors working in a branch, not main/master, test on Windows and MacOS
# Quick, not exhaustive. Minimum interpreter versions
on:
push:
branches:
- '**'
- '!$default-branch'
workflow_dispatch:

defaults:
run:
shell: bash

env:
PIP_DISABLE_PIP_VERSION_CHECK: 1

permissions:
contents: read

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
tests-other:
name: "${{ matrix.python-version }} on ${{ matrix.os-short }}"
runs-on: "${{ matrix.os }}"
# If it doesn't finish in an hour, it's not going to. Don't spin for six
# hours needlessly.
timeout-minutes: 60

strategy:
matrix:
os:
- macos
- windows
python-version:
- "3.9"
- "3.12"
- "3.13"
fail-fast: false

steps:
- name: "Check out the repo"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: "Install ${{ matrix.python-version }} with setup-python"
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
if: "startsWith(matrix.python-version, 'pypy-')"
with:
python-version: "${{ matrix.python-version }}"

- name: "Show diagnostic info"
run: |
set -xe
python -VV
python -m site
env
- name: "Install dependencies"
run: |
set -xe
python -m pip install -r requirements/tox.pip
- name: "Run tox for ${{ matrix.python-version }}"
run: |
python -m tox -- -rfsEX
- name: "Retry tox for ${{ matrix.python-version }}"
if: failure()
run: |
# `exit 1` makes sure that the job remains red with flaky runs
python -m tox -- -rfsEX --lf -vvvvv && exit 1
# This job aggregates test results. It's the required check for branch protection.
# https://github.com/marketplace/actions/alls-green#why
# https://github.com/orgs/community/discussions/33579
success:
name: Jobs successful
# The tests didn't run if the branch name includes "-notests"
if: "!contains(github.ref, '-notests')"
needs:
- tests-other
runs-on: ubuntu-latest

steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
with:
jobs: ${{ toJSON(needs) }}
33 changes: 19 additions & 14 deletions .github/workflows/python-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,45 +30,50 @@ concurrency:

jobs:
tests:
name: "${{ matrix.python-version }}"
# Choose a recent Ubuntu that deadsnakes still builds all the versions for.
# For example, deadsnakes doesn't provide 3.10 nightly for 22.04 (jammy)
# because jammy ships 3.10, and deadsnakes doesn't want to clobber it.
# https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly/+packages
# https://github.com/deadsnakes/issues/issues/234
# bionic: 18, focal: 20, jammy: 22
runs-on: ubuntu-20.04
name: "${{ matrix.python-version }} on ${{ matrix.os-short }}"
runs-on: "${{ matrix.os }}"
# If it doesn't finish in an hour, it's not going to. Don't spin for six
# hours needlessly.
timeout-minutes: 60

strategy:
matrix:
os:
# Choose a recent Ubuntu that deadsnakes still builds all the versions for.
# For example, deadsnakes doesn't provide 3.10 nightly for 22.04 (jammy)
# because jammy ships 3.10, and deadsnakes doesn't want to clobber it.
# https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly/+packages
# https://github.com/deadsnakes/issues/issues/234
# See https://github.com/deadsnakes/nightly for the source of the nightly
# builds.
# bionic: 18, focal: 20, jammy: 22, noble: 24
- "ubuntu-22.04"
os-short:
- "ubuntu"
python-version:
# When changing this list, be sure to check the [gh] list in
# tox.ini so that tox will run properly. PYVERSIONS
# Available versions:
# https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly/+packages
- "3.11-dev"
- "3.12-dev"
- "3.13-dev"
- "3.12"
- "3.13"
# https://github.com/actions/setup-python#available-versions-of-pypy
- "pypy-3.9-nightly"
- "pypy-3.10-nightly"
fail-fast: false

steps:
- name: "Check out the repo"
uses: "actions/checkout@v4"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: "Install ${{ matrix.python-version }} with deadsnakes"
uses: deadsnakes/action@6c8b9b82fe0b4344f4b98f2775fcc395df45e494
uses: deadsnakes/action@92fe45d56d7f36bed36f609fa2bf75b8bf256bd8 # v3.1.0
if: "!startsWith(matrix.python-version, 'pypy-')"
with:
python-version: "${{ matrix.python-version }}"

- name: "Install ${{ matrix.python-version }} with setup-python"
uses: "actions/setup-python@v5"
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
if: "startsWith(matrix.python-version, 'pypy-')"
with:
python-version: "${{ matrix.python-version }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
set -xe
pytest --showlocals --quiet --cov=sphinx_external_toc_strict --cov-report=xml tests
- name: "Upload to Codecov"
uses: codecov/codecov-action@v4.3.0
uses: codecov/codecov-action@v4.5.0
with:
name: unittest-py3.9
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
12 changes: 12 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Changelog
Feature request
.................

- migrate docs from rtd --> gh pages

- https://allcontributors.org/
- https://shields.io/badges/git-hub-contributors-from-allcontributors-org

Expand All @@ -23,6 +25,16 @@ Changelog

.. scriv-start-here
.. _changes_1-2-2:

Version 1.2.2 — 2024-08-31
--------------------------

- ci(python-nightly): fix ubuntu versions
- ci(branch-test-others): add branches test Windows and MacOS
- ci(test-coverage): codecov/codecov-action 4.3.0 --> 4.5.0
- test: coverage omit igor.py and setup.py and vendered packages

.. _changes_1-2-0:

Version 1.2.0 — 2024-08-15
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ It also allows for documents not specified in the ToC to be auto-excluded.
**New in 1.2.x:**

create_site no overwrite and existing files informative message;
SiteMap.file_format ignore unknown use cases;
SiteMap.file_format ignore unknown use cases; branches test Windows and MacOS;

**New in 1.1.x:**

Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
# @@@ editable
copyright = "2023–2024, Dave Faulkmore"
# The short X.Y.Z version.
version = "1.2.0"
version = "1.2.2"
# The full version, including alpha/beta/rc tags.
release = "1.2.0"
release = "1.2.2"
# The date of release, in "monthname day, year" format.
release_date = "August 15, 2024"
release_date = "August 31, 2024"
# @@@ end

v = parse(release)
Expand Down
2 changes: 1 addition & 1 deletion docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This extension facilitates a **top-down** approach to defining the site-map stru
**New in 1.2.x:**

create_site no overwrite and existing files informative message;
SiteMap.file_format ignore unknown use cases;
SiteMap.file_format ignore unknown use cases; branches test Windows and MacOS;

**New in 1.1.x:**

Expand Down
1 change: 1 addition & 0 deletions howto.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
$ git switch main
$ git merge -S -m "Your merge commit message" [source_branch]
- Check web connection then push. Don't trigger a release until a tag push
- Check build sdist first
$ git push
- Start the kits:
- Update logging_strict/src/_version.py with next version and build (not tagged yet)
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ ignore_missing_imports = true
[tool.coverage.run]
source_pkgs = ["sphinx_external_toc_strict"] # **REQUIRED** to be set correctly. Your package name
branch = true
omit = [
"setup.py",
"igor.py",
# Don't worry about covering vendored libraries
"src/sphinx_external_toc_strict/_vendored/*",
]

[tool.coverage.report]
exclude_lines = [
Expand All @@ -99,6 +105,7 @@ exclude_lines = [
"@abc.abstractproperty",
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
"^\\s*pass\\s*$",
]
precision = 2
ignore_errors = true
Expand Down

0 comments on commit e3741da

Please sign in to comment.