-
-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow platform to be spoofed for coverage
- Loading branch information
Showing
4 changed files
with
118 additions
and
130 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,17 +38,18 @@ jobs: | |
runs-on: ${{ matrix.platform }}-latest | ||
continue-on-error: ${{ matrix.experimental }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ "macOS", "Ubuntu", "Windows" ] | ||
platform: [ "macos", "ubuntu", "windows" ] | ||
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12-dev" ] | ||
include: | ||
- experimental: false | ||
# Allow dev Python to fail without failing entire job | ||
- python-version: "3.12-dev" | ||
experimental: true | ||
# Run tests against the latest Windows Store Python | ||
- platform: "Windows" | ||
python-version: "winstore" | ||
- platform: "windows" | ||
python-version: "winstore3.11" | ||
experimental: false | ||
steps: | ||
- name: Checkout | ||
|
@@ -63,8 +64,10 @@ jobs: | |
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Windows Store Python | ||
if: matrix.python-version == 'winstore' | ||
if: startswith(matrix.python-version, 'winstore') | ||
uses: beeware/.github/.github/actions/install-win-store-python@main | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Get Packages | ||
uses: actions/[email protected] | ||
|
@@ -81,26 +84,36 @@ jobs: | |
python -m pip install $(ls dist/briefcase-*.whl)[dev] | ||
- name: Test | ||
id: test | ||
env: | ||
COVERAGE_FILE: ".coverage.${{ matrix.platform }}.${{ matrix.python-version }}" | ||
run: tox -e py --installpkg dist/briefcase-*.whl | ||
|
||
- name: Store Coverage Data | ||
if: success() || failure() | ||
if: always() && (steps.test.outcome == 'failure' || steps.test.outcome == 'success') | ||
uses: actions/[email protected] | ||
with: | ||
name: coverage-data | ||
path: ".coverage.*" | ||
if-no-files-found: ignore | ||
|
||
coverage-platform: | ||
name: Platform coverage - ${{ matrix.platform }} | ||
runs-on: ${{ matrix.platform }}-latest | ||
- name: Report Platform Coverage | ||
id: coverage | ||
if: always() && (steps.test.outcome == 'failure' || steps.test.outcome == 'success') | ||
run: tox -qe coverage$(echo '${{ matrix.python-version }}' | tr -dc '0-9')-html | ||
|
||
- name: Upload HTML Coverage Report | ||
if: always() && steps.coverage.outcome == 'failure' | ||
uses: actions/[email protected] | ||
with: | ||
name: html-coverage-report-${{ matrix.platform }}-${{ matrix.python-version }} | ||
path: htmlcov | ||
|
||
coverage: | ||
name: Project coverage | ||
runs-on: ubuntu-latest | ||
needs: unit-tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ "macOS", "Ubuntu", "Windows" ] | ||
if: always() && needs.unit-tests.result == 'success' | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
@@ -110,12 +123,9 @@ jobs: | |
- name: Setup Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: | | ||
3.12-dev | ||
3.11 | ||
3.10 | ||
3.9 | ||
3.8 | ||
# Use minimum version of python for coverage to avoid phantom branches | ||
# https://github.com/nedbat/coveragepy/issues/1572#issuecomment-1522546425 | ||
python-version: "3.8" | ||
|
||
- name: Install dev Dependencies | ||
run: | | ||
|
@@ -130,104 +140,78 @@ jobs: | |
with: | ||
name: coverage-data | ||
|
||
- name: ${{ matrix.platform }} Coverage Report | ||
env: | ||
COVERAGE_FILE: ".coverage.${{ matrix.platform }}" | ||
run: tox -qe coverage-platform-html-keep | ||
|
||
- name: Python 3.12 on ${{ matrix.platform }} Coverage Report | ||
- name: Linux Coverage Report | ||
id: linux-coverage | ||
if: success() || failure() | ||
continue-on-error: true | ||
env: | ||
COVERAGE_FILE: ".coverage.${{ matrix.platform }}.3.12-dev" | ||
run: tox -qe coverage312-html-keep | ||
COVERAGE_FILE: ".coverage.ubuntu" | ||
COVERAGE_PLATFORM: "linux" | ||
run: tox -qe coverage-platform-html | ||
|
||
- name: Python 3.11 on ${{ matrix.platform }} Coverage Report | ||
if: success() || failure() | ||
env: | ||
COVERAGE_FILE: ".coverage.${{ matrix.platform }}.3.11" | ||
run: tox -qe coverage311-html-keep | ||
- name: Upload Linux Coverage HTML Report | ||
if: always() && steps.linux-coverage.outcome == 'failure' | ||
uses: actions/[email protected] | ||
with: | ||
name: html-coverage-report-Linux | ||
path: htmlcov | ||
|
||
- name: Python 3.10 on ${{ matrix.platform }} Coverage Report | ||
- name: macOS Coverage Report | ||
id: macos-coverage | ||
if: success() || failure() | ||
env: | ||
COVERAGE_FILE: ".coverage.${{ matrix.platform }}.3.10" | ||
run: tox -qe coverage310-html-keep | ||
COVERAGE_FILE: ".coverage.macos" | ||
COVERAGE_PLATFORM: "darwin" | ||
run: tox -qe coverage-platform-html | ||
|
||
- name: Python 3.9 on ${{ matrix.platform }} Coverage Report | ||
if: success() || failure() | ||
env: | ||
COVERAGE_FILE: ".coverage.${{ matrix.platform }}.3.9" | ||
run: tox -qe coverage39-html-keep | ||
- name: Upload macOS Coverage HTML Report | ||
if: always() && steps.macos-coverage.outcome == 'failure' | ||
uses: actions/[email protected] | ||
with: | ||
name: html-coverage-report-macOS | ||
path: htmlcov | ||
|
||
- name: Python 3.8 on ${{ matrix.platform }} Coverage Report | ||
- name: Windows Coverage Report | ||
id: windows-coverage | ||
if: success() || failure() | ||
env: | ||
COVERAGE_FILE: ".coverage.${{ matrix.platform }}.3.8" | ||
run: tox -qe coverage38-html-keep | ||
COVERAGE_FILE: ".coverage.windows" | ||
COVERAGE_PLATFORM: "win32" | ||
run: tox -qe coverage-platform-html | ||
|
||
- name: Upload HTML Coverage Report | ||
if: failure() | ||
- name: Upload Windows Coverage HTML Report | ||
if: always() && steps.windows-coverage.outcome == 'failure' | ||
uses: actions/[email protected] | ||
with: | ||
name: html-platform-coverage-report-${{ matrix.platform }} | ||
name: html-coverage-report-Windows | ||
path: htmlcov | ||
|
||
coverage-project: | ||
name: Project coverage | ||
runs-on: ubuntu-latest | ||
needs: unit-tests | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Python | ||
uses: actions/[email protected] | ||
with: | ||
# Use minimum version of python for coverage to avoid phantom branches | ||
# https://github.com/nedbat/coveragepy/issues/1572#issuecomment-1522546425 | ||
python-version: "3.8" | ||
|
||
- name: Install dev Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade setuptools | ||
# We don't actually want to install briefcase; we just | ||
# want the dev extras so we have a known version of tox. | ||
python -m pip install -e .[dev] | ||
- name: Retrieve Coverage Data | ||
uses: actions/[email protected] | ||
with: | ||
name: coverage-data | ||
|
||
- name: Project Coverage Report | ||
id: project-coverage | ||
if: success() || failure() | ||
run: tox -qe coverage-project-html | ||
|
||
- name: Upload HTML Coverage Report | ||
if: failure() | ||
- name: Upload Project Coverage HTML Report | ||
if: always() && steps.project-coverage.outcome == 'failure' | ||
uses: actions/[email protected] | ||
with: | ||
name: html-project-coverage-report | ||
name: html-coverage-report-project | ||
path: htmlcov | ||
|
||
# verify-apps: | ||
# name: Build app | ||
# needs: unit-tests | ||
# uses: beeware/.github/.github/workflows/app-build-verify.yml@main | ||
# with: | ||
# # This *must* be the version of Python that is the system Python on the | ||
# # Ubuntu version used to run Linux tests. We use a fixed ubuntu-22.04 | ||
# # rather than `-latest` because at some point, `-latest` will become | ||
# # `-24.04`, but it will be a soft changeover, which will cause havoc with | ||
# # the hard Python version requirement for local system packages. | ||
# python-version: "3.10" | ||
# runner-os: ${{ matrix.runner-os }} | ||
# framework: ${{ matrix.framework }} | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# framework: [ "toga", "pyside2", "pyside6", "ppb", "pygame" ] | ||
# runner-os: [ "macos-latest", "ubuntu-22.04", "windows-latest" ] | ||
verify-apps: | ||
name: Build app | ||
needs: unit-tests | ||
uses: beeware/.github/.github/workflows/app-build-verify.yml@main | ||
with: | ||
# This *must* be the version of Python that is the system Python on the | ||
# Ubuntu version used to run Linux tests. We use a fixed ubuntu-22.04 | ||
# rather than `-latest` because at some point, `-latest` will become | ||
# `-24.04`, but it will be a soft changeover, which will cause havoc with | ||
# the hard Python version requirement for local system packages. | ||
python-version: "3.10" | ||
runner-os: ${{ matrix.runner-os }} | ||
framework: ${{ matrix.framework }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
framework: [ "toga", "pyside2", "pyside6", "ppb", "pygame" ] | ||
runner-os: [ "macos-latest", "ubuntu-22.04", "windows-latest" ] |
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
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
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