update how WAKEPY_FAKE_SUCCESS works - only affects Modes #73
Workflow file for this run
This file contains 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: Build and test wakepy | |
'on': | |
# Allows for manually starting tests | |
workflow_dispatch: | |
# Make this a reusable workflow | |
workflow_call: | |
# Triggers when pull request is created and when pushing to PR | |
pull_request: | |
# Common environment variables | |
env: | |
TOX_REQUIREMENT: 'tox -c requirements/requirements-test.txt' | |
# List of available versions: https://github.com/actions/python-versions/blob/main/versions-manifest.json | |
PYTHON_VERSION: '3.10' | |
jobs: | |
build-python-distributions: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get history and tags for setuptools-scm | |
run: | | |
git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
git describe --tags | |
git describe --tags $(git rev-list --tags --max-count=1) | |
- name: Install python | |
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d #v5.1 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: install tox | |
run: | | |
python${{ env.PYTHON_VERSION }} -m pip install -U pip wheel && \ | |
python${{ env.PYTHON_VERSION }} -m pip install ${{ env.TOX_REQUIREMENT }} | |
- name: Build with tox | |
run: tox -e build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wakepy-python-packages | |
path: ./dist/*.* | |
if-no-files-found: error | |
retention-days: 1 | |
test: | |
runs-on: ${{ matrix.os }} | |
needs: build-python-distributions | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.7", "3.10", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wakepy-python-packages | |
path: ./dist/ | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d #v5.1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: install tox | |
run: | | |
python -m pip install -U pip wheel && | |
python -m pip install ${{ env.TOX_REQUIREMENT }} | |
- run: python -c "import sys; print(sys.executable)" | |
- run: python -c "import platform; print(platform.platform())" | |
- name: Run tox | |
run: tox -e ${{ matrix.python-version }} --skip-build | |
- name: Show lines not covered by tests | |
# No need to run this is all tests and coverage check passes | |
if: failure() | |
run: tox -e show-uncovered-lines | |
check-code: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install python | |
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d #v5.1 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: install tox | |
run: | | |
python${{ env.PYTHON_VERSION }} -m pip install -U pip wheel && \ | |
python${{ env.PYTHON_VERSION }} -m pip install ${{ env.TOX_REQUIREMENT }} | |
- name: Check code | |
run: tox -e check | |
test-build-docs: | |
runs-on: ubuntu-latest | |
needs: build-python-distributions | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install python | |
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d #v5.1 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: install tox | |
run: | | |
python${{ env.PYTHON_VERSION }} -m pip install -U pip wheel && \ | |
python${{ env.PYTHON_VERSION }} -m pip install ${{ env.TOX_REQUIREMENT }} | |
- name: Test building docs | |
run: tox -e builddocs | |
# Cancel in-progress jobs/runs for the same workflow; if you push to same | |
# pull request twice, the previous workflow should be canceled. | |
# From: https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
# See: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs | |
permissions: | |
actions: write | |
checks: none | |
contents: read | |
deployments: none | |
id-token: none | |
issues: none | |
discussions: none | |
packages: none | |
pages: none | |
pull-requests: none | |
repository-projects: none | |
security-events: read | |
statuses: none |