Skip to content

improve release process order: do version bump in branch and merge to… #1375

improve release process order: do version bump in branch and merge to…

improve release process order: do version bump in branch and merge to… #1375

Workflow file for this run

name: Build
on:
- push
- pull_request
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-3.12
python-version: "3.12"
os: ubuntu-latest
- name: windows-3.12
python-version: "3.12"
os: windows-latest
- name: macos-3.12-skip-exe
python-version: "3.12"
os: macos-latest
- name: linux-3.12-lint-update-help-skip-exe
python-version: "3.12"
os: ubuntu-latest
- name: linux-3.11-pytype-skip-exe
python-version: "3.11"
os: ubuntu-latest
- name: linux-3.10-skip-exe
python-version: "3.10"
os: ubuntu-latest
- name: linux-3.9-skip-exe
python-version: "3.9"
os: ubuntu-latest
- name: linux-3.8-skip-exe
python-version: "3.8"
os: ubuntu-latest
- name: linux-pypy-3.10-skip-exe
python-version: pypy-3.10
os: ubuntu-latest
- name: linux-pypy-3.9-skip-exe
python-version: pypy-3.9
os: ubuntu-latest
- name: linux-pypy-3.8-skip-exe
python-version: pypy-3.8
os: ubuntu-latest
steps:
- name: Checkout source repo
uses: actions/checkout@v4
- name: Apt install system dependencies (linux unless -skip-exe)
if: ${{ startsWith(matrix.name, 'linux-') && !contains(matrix.name, '-skip-exe') }}
run: |
echo "::group::Run sudo apt-get update"
sudo apt-get update
echo "::endgroup::"
echo "::group::Run sudo apt-get install graphviz"
sudo apt-get install graphviz
echo "::endgroup::"
echo "::group::Run dot -V"
DOT_VERSION="$(dot -V 2>&1)"
echo $DOT_VERSION;
echo "::endgroup::"
echo "::notice::Apt installed ${DOT_VERSION#dot - }"
shell: bash
- name: Brew install system dependencies (macos unless -skip-exe)
if: ${{ startsWith(matrix.name, 'macos-') && !contains(matrix.name, '-skip-exe') }}
run: |
echo "::group::Run brew update --preinstall"
brew update --preinstall
echo "::endgroup::"
echo "::group::Run brew install graphviz"
brew install graphviz
echo "::endgroup::"
echo "::group::Run dot -V"
DOT_VERSION="$(dot -V 2>&1)"
echo $DOT_VERSION
echo "::endgroup::"
echo "::notice::Brew installed ${DOT_VERSION#dot - }"
shell: bash
- name: Choco install system dependencies (windows unless -skip-exe)
if: ${{ startsWith(matrix.name, 'windows-') && !contains(matrix.name, '-skip-exe') }}
run: |
echo "::group::Run choco install --no-progress graphviz"
choco install --no-progress graphviz
echo "::endgroup::"
echo "::group::Run dot -V"
DOT_VERSION="$(dot -V 2>&1)"
echo $DOT_VERSION
echo "::endgroup::"
echo "::notice::Choco installed ${DOT_VERSION#dot - }"
shell: bash
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Pip install dependencies
run: |
echo "::group::Run python -m pip install --upgrade pip setuptools wheel"
python -m pip install --upgrade pip setuptools wheel
echo "::endgroup::"
echo "::group::Run pip install .[test] flake8"
pip install .[test] flake8
echo "::endgroup::"
- name: Run full tests (unless -skip-exe)
if: ${{ !contains(matrix.name, '-skip-exe') }}
run: python run-tests.py
- name: Run tests with --only-exe (unless -skip-exe)
if: ${{ !contains(matrix.name, '-skip-exe') }}
run: python run-tests.py --only-exe --cov-append
- name: Run tests with --skip-exe (always included)
run: python run-tests.py --skip-exe --cov-append
- name: Upload test coverage
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Check test coverage
run: |
echo "::group::Run coverage report --fail-under=100 --show-missing --skip-covered"
FAILED=0
coverage report --fail-under=100 --show-missing --skip-covered || FAILED=$?
echo "::endgroup::"
[ $FAILED -eq 0 ] || echo "::warning::coverage report --fail-under=100 failed with exit code $FAILED"
shell: bash
- name: Run build-docs.py -b doctest (unless -skip-exe)
if: ${{ !contains(matrix.name, '-skip-exe') }}
run: |
echo "::group::Run pip install .[docs]"
pip install .[docs]
echo "::endgroup::"
echo "::group::Run build-docs.py -b doctest"
FAILED=0
python build-docs.py -b doctest || FAILED=$?
echo ::endgroup::
[ $FAILED -eq 0 ] || echo "::warning::build-docs.py -b doctest failed with exit code $FAILED"
shell: bash
- name: Run try-examples.py (unless -skip-exe)
if: ${{ !contains(matrix.name, '-skip-exe') }}
run: |
echo "::group::Run try-examples.py"
FAILED=0
python try-examples.py || FAILED=$?
echo "::endgroup::"
SEVERITY=warning
${{ startsWith(matrix.name, 'windows-') }} && SEVERITY=notice
[ $FAILED -eq 0 ] || echo "::$SEVERITY::try-examples.py failed with exit code $FAILED (XFAIL 'Graphviz not built with triangulation library' on Windows cbuild)"
shell: bash
- name: Run lint-code.py (if -lint)
if: ${{ contains(matrix.name, '-lint') }}
run: |
echo "::group::Run lint-code.py"
FAILED=0
python lint-code.py || FAILED=$?
echo "::endgroup::"
[ $FAILED -eq 0 ] || echo "::warning::lint-code.py failed with exit code $FAILED"
shell: bash
- name: Run update-help.py (if -update-help)
if: ${{ contains(matrix.name, '-update-help') }}
run: |
echo "::group::Run update-help.py"
FAILED=0
python update-help.py || FAILED=$?
echo "::endgroup::"
[ $FAILED -eq 0 ] || echo "::warning::update-help.py failed with exit code $FAILED"
- name: Run pytype (if -pytype)
if: ${{ contains(matrix.name, '-pytype') }}
run: |
echo "::group::Run pip install pytype"
pip install pytype
echo "::endgroup::"
echo "::group::Run pytype"
FAILED=0
pytype || FAILED=$?
echo "::endgroup::"
[ $FAILED -eq 0 ] || echo "::warning::pytype failed with exit code $FAILED"
shell: bash
- name: Upload ${{ matrix.name }} artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: |
test-log.txt
doctest-output/
examples/*.gv
examples/*.pdf