From f52e45ee890efd3170f4b06f2c86b0c03c64c632 Mon Sep 17 00:00:00 2001 From: Russell Martin Date: Sat, 18 Nov 2023 04:01:57 -0500 Subject: [PATCH 1/2] Run apps created in `app-build-verify` --- .github/actions/app-create/action.yml | 31 +-- .github/actions/install-briefcase/action.yml | 6 +- .github/workflows/app-build-verify.yml | 187 +++++++++++-------- .github/workflows/app-create-verify.yml | 45 ++--- .github/workflows/ci.yml | 98 ++++++---- .github/workflows/python-package-create.yml | 8 +- 6 files changed, 221 insertions(+), 154 deletions(-) diff --git a/.github/actions/app-create/action.yml b/.github/actions/app-create/action.yml index 13922c83..7ffa3cb2 100644 --- a/.github/actions/app-create/action.yml +++ b/.github/actions/app-create/action.yml @@ -11,6 +11,9 @@ inputs: briefcase-template-branch: description: "The git branch for the template to use to roll out the project." required: false + enable-automation: + description: "Whether to create a project using the Briefcase Automation plugin." + default: "false" # all composite workflow inputs are of type string testing-pr-body: description: "Override value for body of PR; only for testing." required: false @@ -63,16 +66,18 @@ runs: TEMPLATE_BRANCH=$(printf -- "--template-branch %q" "${{ steps.template-override.outputs.ref }}") fi - # Map the requested GUI toolkit to the input that Briefcase expects - # Default to the input to accommodate arbitrary toolkits installed as plugins - case "$(tr '[:upper:]' '[:lower:]' <<< '${{ inputs.framework }}')" in - toga ) GUI_INPUT=1 ;; - pyside6 ) GUI_INPUT=2 ;; - ppb ) GUI_INPUT=3 ;; - pygame ) GUI_INPUT=4 ;; - * ) GUI_INPUT=${{ inputs.framework }} ;; + # Map GUI toolkit through case insensitivity + case "$(tr '[:upper:]' '[:lower:]' <<< "${{ inputs.framework }}")" in + toga ) BOOTSTRAP=Toga ;; + pyside6 ) BOOTSTRAP=PySide6 ;; + ppb ) BOOTSTRAP=PursuedPyBear ;; + pygame ) BOOTSTRAP=Pygame ;; + * ) BOOTSTRAP=${{ inputs.framework }} ;; esac + # If enabled, use the Automation bootstrap + [ "${{ inputs.enable-automation }}" != "false" ] && BOOTSTRAP="${BOOTSTRAP} Automation" + ROOT_DIR="apps" APP_NAME="Verify App" APP_DIR="verifyapp" @@ -84,10 +89,14 @@ runs: rm -rf "${APP_DIR}" # Roll out the project - printf "%s\n%s\n\n\n\n\n\n\n\n%s\n" "${APP_NAME}" "${APP_DIR}" "${GUI_INPUT}" \ - | briefcase new ${TEMPLATE} ${TEMPLATE_BRANCH} + briefcase new --no-input ${TEMPLATE} ${TEMPLATE_BRANCH} \ + -Q "formal_name=${APP_NAME}" \ + -Q "app_name=${APP_DIR}" \ + -Q "bootstrap=${BOOTSTRAP}" - echo "Rolled out project to ${APP_PATH} (${{ inputs.framework }}->${GUI_INPUT})" + echo "Rolled out project to ${APP_PATH}" + echo " > GUI Toolkit: ${{ inputs.framework }}" + echo " > Bootstrap: ${BOOTSTRAP}" printf "::group::pyproject.toml\n%s\n::endgroup::\n" "$(cat "${APP_DIR}/pyproject.toml")" printf "::group::app.py\n%s\n::endgroup::\n" "$(cat "${APP_DIR}/src/${APP_DIR}/app.py")" echo "path=${APP_PATH}" >> ${GITHUB_OUTPUT} diff --git a/.github/actions/install-briefcase/action.yml b/.github/actions/install-briefcase/action.yml index 9aff8dd8..8de59741 100644 --- a/.github/actions/install-briefcase/action.yml +++ b/.github/actions/install-briefcase/action.yml @@ -140,7 +140,11 @@ runs: REF="${{ steps.briefcase-override.outputs.ref || steps.briefcase-derived.outputs.version }}" echo "Installing ${REPO}@${REF}" - python -m pip install -U "git+${REPO}@${REF}" + python -m pip install \ + --upgrade \ + --upgrade-strategy eager \ + "git+${REPO}@${REF}" \ + "git+${REPO}@${REF}#subdirectory=automation" echo "Installed version: $(briefcase --version)" echo "version=${REF}" >> ${GITHUB_OUTPUT} diff --git a/.github/workflows/app-build-verify.yml b/.github/workflows/app-build-verify.yml index ccf0daf9..98c7f369 100644 --- a/.github/workflows/app-build-verify.yml +++ b/.github/workflows/app-build-verify.yml @@ -32,12 +32,14 @@ on: description: "The target format for the app, e.g. appimage, xcode, app, etc. Leave blank all supported formats." default: "" type: string - briefcase-template-source: - description: "Path to use for --template for `briefcase new` to create app." - default: "" + workflow-repo: + # Only needed for PRs in other repos wanting to test new workflow changes before they are merged. + # These inputs should not be specified by another repo on their main branch. + description: "The repo to use to run additional workflows and actions." + default: "beeware/.github" type: string - briefcase-template-branch: - description: "Git branch to use for --template-branch for `briefcase new` to create app." + workflow-repo-ref: + description: "The repo ref to use to run additional workflows and actions." default: "" type: string @@ -52,31 +54,20 @@ jobs: verify-app: name: Verify App Build runs-on: ${{ inputs.runner-os }} + timeout-minutes: 30 + env: + QT_QPA_PLATFORM: offscreen # disable display for Qt + SDL_AUDIODRIVER: dummy # disable audio for SDL + SDL_VIDEODRIVER: dummy # disable display for SDL steps: - - name: Checkout ${{ inputs.repository }} - uses: actions/checkout@v4.1.1 - with: - repository: ${{ inputs.repository }} - fetch-depth: 0 - - - name: Checkout beeware/.github - uses: actions/checkout@v4.1.1 - with: - repository: beeware/.github - path: beeware-.github - - - name: Package Name - id: package - run: echo "name=$(basename '${{ inputs.repository }}')" | tee -a ${GITHUB_OUTPUT} - - - name: Determine Cache Directory - id: dirs + - name: Workflow Configuration + id: config run: | case "$(tr '[:upper:]' '[:lower:]' <<< '${{ inputs.runner-os }}')" in - ubuntu* ) BRIEFCASE_DIR="~/.cache/briefcase" ;; - macos* ) BRIEFCASE_DIR="~/Library/Caches/org.beeware.briefcase" ;; - windows* ) BRIEFCASE_DIR="~/AppData/Local/BeeWare/briefcase/Cache" ;; + ubuntu* ) BRIEFCASE_DIR="$HOME/.cache/briefcase" ;; + macos* ) BRIEFCASE_DIR="$HOME/Library/Caches/org.beeware.briefcase" ;; + windows* ) BRIEFCASE_DIR="$HOME/AppData/Local/BeeWare/briefcase/Cache" ;; * ) echo "::error::Failed to determine the Briefcase data directory path" ;; esac echo "briefcase-data-dir=${BRIEFCASE_DIR}" | tee -a ${GITHUB_OUTPUT} @@ -88,19 +79,35 @@ jobs: fi echo "cache-key=$(date +%Y-%m)|${CACHE_KEY}" | tee -a ${GITHUB_OUTPUT} + SYSTEM_PYTHON_VER=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') + echo "system-python-version=${SYSTEM_PYTHON_VER}" | tee -a ${GITHUB_OUTPUT} + + - name: Checkout ${{ inputs.repository }} + uses: actions/checkout@v4.1.1 + with: + repository: ${{ inputs.repository }} + fetch-depth: 0 + + - name: Checkout ${{ inputs.workflow-repo }}${{ inputs.workflow-repo-ref && format('@{0}', inputs.workflow-repo-ref) || '' }} + uses: actions/checkout@v4.1.1 + with: + repository: ${{ inputs.workflow-repo }} + ref: ${{ inputs.workflow-repo-ref }} + path: beeware-.github + + - name: Update Package Manager + if: startsWith(inputs.runner-os, 'ubuntu') + run: sudo apt update -y + - name: Cache Briefcase Tools uses: actions/cache@v3.3.2 with: - key: briefcase-data|${{ steps.dirs.outputs.cache-key }} - path: ${{ steps.dirs.outputs.briefcase-data-dir }} - - - name: Determine System python3 Version - id: system-python - run: | - SYSTEM_PYTHON_VER=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') - echo "version=${SYSTEM_PYTHON_VER}" | tee -a ${GITHUB_OUTPUT} + key: briefcase-data|${{ steps.config.outputs.cache-key }} + path: ${{ steps.config.outputs.briefcase-data-dir }} - name: Set Up Python + # Linux System apps requires python is System Python to run the app + if: ${{ !startsWith(inputs.runner-os, 'ubuntu') }} uses: actions/setup-python@v4.7.1 with: python-version: ${{ inputs.python-version }} @@ -110,35 +117,30 @@ jobs: **/pyproject.toml .pre-commit-config.yaml - - name: Get Packages + - name: Get Briefcase Packages # Briefcase will build and package itself in a previous step in its CI if: endsWith(inputs.repository, 'briefcase') uses: actions/download-artifact@v3.0.2 with: - name: packages-${{ steps.package.outputs.name }} + name: packages-briefcase path: dist - - name: Install Briefcase Artefact + - name: Install Briefcase Artefacts if: endsWith(inputs.repository, 'briefcase') - run: python -m pip install dist/briefcase-*.whl + run: python3 -m pip install -U dist/briefcase-*.whl dist/x_briefcase_automation-*.whl --upgrade-strategy eager - name: Install Briefcase if: ${{ !endsWith(inputs.repository, 'briefcase') }} uses: ./beeware-.github/.github/actions/install-briefcase - - name: Determine Briefcase Template Path - # If the briefcase-template repo is being tested, use the current checkout - id: template - if: endsWith(inputs.repository, 'briefcase-template') - run: echo "path=${{ github.workspace }}" | tee -a ${GITHUB_OUTPUT} - - name: Create Briefcase Project id: create uses: ./beeware-.github/.github/actions/app-create with: framework: ${{ inputs.framework }} - briefcase-template-source: ${{ inputs.briefcase-template-source || steps.template.outputs.path }} - briefcase-template-branch: ${{ inputs.briefcase-template-branch }} + # use the current repo checkout if briefcase-template is being tested + briefcase-template-source: ${{ endsWith(inputs.repository, 'briefcase-template') && github.workspace || '' }} + enable-automation: true - name: Determine Output Format Configuration # only used for the template repos so apps are built with the PR version of the template; @@ -149,8 +151,8 @@ jobs: # Since the current repo is cloned in to the workspace, use it for the template echo "template-override=$(printf -- "--config template=%q" "'${{ github.workspace }}'")" | tee -a ${GITHUB_OUTPUT} - # In the steps below, using the builtin functions for comparison (instead of ==) - # allows for case-insensitivity to the inputs for the workflow. + # In the steps below, the builtin functions (i.e. contains, startsWith, etc.) + # are used for comparison (instead of ==) because they are case-insensitive. - name: Build macOS App if: > @@ -162,6 +164,7 @@ jobs: briefcase create macOS app \ ${{ steps.output-format.outputs.template-override }} briefcase build macOS app + briefcase run macOS app briefcase package macOS app --adhoc-sign - name: Build macOS Xcode Project @@ -174,6 +177,7 @@ jobs: briefcase create macOS Xcode \ ${{ steps.output-format.outputs.template-override }} briefcase build macOS Xcode + briefcase run macOS Xcode briefcase package macOS Xcode --adhoc-sign - name: Build Windows App @@ -181,13 +185,12 @@ jobs: startsWith(inputs.runner-os, 'Windows') && contains(fromJSON('["", "Windows"]'), inputs.target-platform) && contains(fromJSON('["", "app"]'), inputs.target-format) - env: - WIX: "" # force Briefcase to install and use its own version of WiX working-directory: ${{ steps.create.outputs.project-path }} run: | briefcase create windows app \ ${{ steps.output-format.outputs.template-override }} briefcase build windows app + briefcase run windows app briefcase package windows app --adhoc-sign - name: Build Windows Visual Studio Project @@ -195,29 +198,34 @@ jobs: startsWith(inputs.runner-os, 'Windows') && contains(fromJSON('["", "Windows"]'), inputs.target-platform) && contains(fromJSON('["", "VisualStudio"]'), inputs.target-format) - env: - WIX: "" # force Briefcase to install and use its own version of WiX working-directory: ${{ steps.create.outputs.project-path }} run: | briefcase create windows VisualStudio \ ${{ steps.output-format.outputs.template-override }} briefcase build windows VisualStudio + briefcase run windows VisualStudio briefcase package windows VisualStudio --adhoc-sign - name: Build Linux System Project (Ubuntu, local) if: > startsWith(inputs.runner-os, 'ubuntu') - && startsWith(inputs.python-version, steps.system-python.outputs.version) + && startsWith(inputs.python-version, steps.config.outputs.system-python-version) && contains(fromJSON('["", "Linux"]'), inputs.target-platform) && contains(fromJSON('["", "system"]'), inputs.target-format) working-directory: ${{ steps.create.outputs.project-path }} run: | - sudo apt update -y - sudo apt install -y --no-install-recommends python3-dev python3-pip libcairo2-dev libgirepository1.0-dev + PACKAGES="python3-dev python3-pip" + case "$(tr '[:upper:]' '[:lower:]' <<< '${{ inputs.framework }}')" in + toga ) PACKAGES="${PACKAGES} libcairo2-dev libgirepository1.0-dev gir1.2-gtk-3.0" ;; + pyside6 ) PACKAGES="${PACKAGES} libegl1" ;; + esac + + sudo apt install -y --no-install-recommends ${PACKAGES} briefcase create linux system \ ${{ steps.output-format.outputs.template-override }} briefcase build linux system + xvfb-run briefcase run linux system briefcase package linux system --adhoc-sign - name: Build Linux System Project (Debian, Dockerized) @@ -239,10 +247,10 @@ jobs: && contains(fromJSON('["", "system"]'), inputs.target-format) working-directory: ${{ steps.create.outputs.project-path }} run: | - briefcase create linux system --target fedora:37 \ + briefcase create linux system --target fedora:39 \ ${{ steps.output-format.outputs.template-override }} - briefcase build linux system --target fedora:37 - briefcase package linux system --target fedora:37 --adhoc-sign + briefcase build linux system --target fedora:39 + briefcase package linux system --target fedora:39 --adhoc-sign - name: Build Linux System Project (Arch, Dockerized) if: > @@ -256,28 +264,36 @@ jobs: briefcase build linux system --target archlinux:latest briefcase package linux system --target archlinux:latest --adhoc-sign - # 2023-09-11 AppImage dropped to "best effort" support. - # - # AppImage builds are the slowest, because they're incompatible with binary wheels; - # and installing Linux GUI toolkits (which are on a constant "install the latest" - # push) is fundamentally incompatible with using an old base image. As of today, - # it's impossible to install Toga on *any* manylinux image ( - # https://gitlab.gnome.org/GNOME/pygobject/-/issues/590); PySide2 can't be - # installed on any *supported* manylinux image, and PySide6 only works on 2_28. - # Even when the install *does* work, there are so many incompatibility and - # binary dependency issues that it's just not worth the oxygen to keep this thing - # alive. - # - # Only runs when target platform and format are explicitly Linux and AppImage. - name: Build AppImage Project + # 2023-09-11 AppImage dropped to "best effort" support. + # + # AppImage builds are the slowest, because they're incompatible with binary wheels; + # and installing Linux GUI toolkits (which are on a constant "install the latest" + # push) is fundamentally incompatible with using an old base image. As of today, + # it's impossible to install Toga on *any* manylinux image ( + # https://gitlab.gnome.org/GNOME/pygobject/-/issues/590); PySide2 can't be + # installed on any *supported* manylinux image, and PySide6 only works on 2_28. + # Even when the install *does* work, there are so many incompatibility and + # binary dependency issues that it's just not worth the oxygen to keep this thing + # alive. + # + # Only runs when target platform and format are explicitly Linux and AppImage. if: > startsWith(inputs.runner-os, 'ubuntu') && contains(fromJSON('["Linux"]'), inputs.target-platform) && contains(fromJSON('["AppImage"]'), inputs.target-format) working-directory: ${{ steps.create.outputs.project-path }} run: | + PACKAGES="libfuse2" + case "$(tr '[:upper:]' '[:lower:]' <<< '${{ inputs.framework }}')" in + toga ) PACKAGES="${PACKAGES} libthai-dev libegl1" ;; + pyside6 ) PACKAGES="${PACKAGES} libegl1" ;; + esac + + sudo apt install -y --no-install-recommends ${PACKAGES} + # PyGObject>=3.46.0 requires a version of glibc that isn't available in manylinux images; - # so, the version will need to be constrained to successfully build an AppImage with Toga. + # so, the version is constrained to successfully build an AppImage with Toga. # Furthermore, Toga>0.3.1 requires PyGObject>=3.46.0 so its version is constrained as well. if [ "${{ startsWith(inputs.framework, 'toga') }}" = "true" ]; then CONFIG_OVERRIDE_REQUIRES='--config requires=["toga-gtk==0.3.1","PyGobject<3.46.0"]' @@ -287,6 +303,7 @@ jobs: ${{ steps.output-format.outputs.template-override }} \ ${CONFIG_OVERRIDE_REQUIRES} briefcase build linux AppImage + xvfb-run briefcase run linux AppImage briefcase package linux AppImage --adhoc-sign - name: Build Flatpak Project @@ -294,15 +311,14 @@ jobs: startsWith(inputs.runner-os, 'ubuntu') && contains(fromJSON('["", "Linux"]'), inputs.target-platform) && contains(fromJSON('["", "Flatpak"]'), inputs.target-format) - && contains(fromJSON('["Toga", "PyGame"]'), inputs.framework) working-directory: ${{ steps.create.outputs.project-path }} run: | - sudo apt update -y sudo apt install -y --no-install-recommends flatpak flatpak-builder elfutils briefcase create linux flatpak \ ${{ steps.output-format.outputs.template-override }} briefcase build linux flatpak + xvfb-run briefcase run linux flatpak briefcase package linux flatpak --adhoc-sign - name: Build Android App @@ -312,9 +328,31 @@ jobs: && startsWith(inputs.framework, 'toga') working-directory: ${{ steps.create.outputs.project-path }} run: | + export JAVA_HOME=${JAVA_HOME_17_X64} + briefcase create android gradle \ ${{ steps.output-format.outputs.template-override }} briefcase build android gradle + + # Only run Android app on Linux since it's duplicative (and slow) on other platforms + if [ "${{ startsWith(inputs.runner-os, 'ubuntu') }}" = "true" ]; then + # drop a few breadcrumbs incase virtualization isn't supported on the runner... + sudo apt install -y --no-install-recommends cpu-checker coreutils && echo "CPUs=$(nproc --all)" && kvm-ok + # allow access to KVM to run the emulator + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \ + | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + briefcase run android gradle \ + --device '{"avd":"beePhone"}' \ + --shutdown-on-exit \ + --Xemulator=-no-window \ + --Xemulator=-no-snapshot \ + --Xemulator=-no-audio \ + --Xemulator=-no-boot-anim + fi + briefcase package android gradle --adhoc-sign - name: Build iOS App @@ -328,6 +366,7 @@ jobs: briefcase create iOS xcode \ ${{ steps.output-format.outputs.template-override }} briefcase build iOS xcode + briefcase run iOS xcode -d "iPhone SE (3rd generation)" briefcase package iOS xcode --adhoc-sign - name: Build Web App diff --git a/.github/workflows/app-create-verify.yml b/.github/workflows/app-create-verify.yml index 44bf7f7e..d6116638 100644 --- a/.github/workflows/app-create-verify.yml +++ b/.github/workflows/app-create-verify.yml @@ -19,12 +19,14 @@ on: description: "Framework to use to build the App, e.g. toga." required: true type: string - briefcase-template-source: - description: "Path to use for --template for `briefcase new` to create app." - default: "" + workflow-repo: + # Only needed for PRs in other repos wanting to test new workflow changes before they are merged. + # These inputs should not be specified by another repo on their main branch. + description: "The repo to use to run additional workflows and actions." + default: "beeware/.github" type: string - briefcase-template-branch: - description: "Git branch to use for --template-branch for `briefcase new` to create app." + workflow-repo-ref: + description: "The repo ref to use to run additional workflows and actions." default: "" type: string @@ -39,6 +41,7 @@ jobs: verify-project: name: Verify Project runs-on: ${{ inputs.runner-os }} + timeout-minutes: 30 steps: - name: Checkout ${{ github.repository }} @@ -47,10 +50,11 @@ jobs: repository: ${{ github.repository }} fetch-depth: 0 - - name: Checkout beeware/.github + - name: Checkout ${{ inputs.workflow-repo }}${{ inputs.workflow-repo-ref && format('@{0}', inputs.workflow-repo-ref) || '' }} uses: actions/checkout@v4.1.1 with: - repository: beeware/.github + repository: ${{ inputs.workflow-repo }} + ref: ${{ inputs.workflow-repo-ref }} path: beeware-.github - name: Checkout beeware/briefcase-template @@ -59,10 +63,6 @@ jobs: repository: beeware/briefcase-template path: briefcase-template - - name: Package Name - id: package - run: echo "name=$(basename '${{ github.repository }}')" >> ${GITHUB_OUTPUT} - - name: Set up Python uses: actions/setup-python@v4.7.1 with: @@ -73,38 +73,33 @@ jobs: **/pyproject.toml .pre-commit-config.yaml - - name: Get Packages + - name: Install Dependencies + # must install before Briefcase below since requirements.txt contains an entry for Briefcase + run: python -m pip install -Ur ./briefcase-template/requirements.txt + + - name: Get Briefcase Package # Briefcase will build and package itself in a previous step in its CI if: endsWith(github.repository, 'briefcase') uses: actions/download-artifact@v3.0.2 with: - name: packages-${{ steps.package.outputs.name }} + name: packages-briefcase path: dist - - name: Install Dependencies - run: python -m pip install -Ur ./briefcase-template/requirements.txt - - name: Install Briefcase Artefact if: endsWith(github.repository, 'briefcase') - run: python -m pip install dist/briefcase-*.whl + run: python -m pip install -U dist/briefcase-*.whl --upgrade-strategy eager - name: Install Briefcase if: ${{ !endsWith(github.repository, 'briefcase') }} uses: ./beeware-.github/.github/actions/install-briefcase - - name: Determine Briefcase Template Path - # If the briefcase-template repo is being tested, use the current checkout - id: template - if: endsWith(github.repository, 'briefcase-template') - run: echo "path=${{ github.workspace }}" | tee -a ${GITHUB_OUTPUT} - - name: Create Briefcase Project id: create uses: ./beeware-.github/.github/actions/app-create with: framework: ${{ inputs.framework }} - briefcase-template-source: ${{ inputs.briefcase-template-source || steps.template.outputs.path }} - briefcase-template-branch: ${{ inputs.briefcase-template-branch }} + # use the current repo checkout if briefcase-template is being tested + briefcase-template-source: ${{ endsWith(github.repository, 'briefcase-template') && github.workspace || '' }} - name: Run Flake8 working-directory: ${{ steps.create.outputs.project-path }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de2a3d2a..479aedab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: test-docs-build-verify: name: Verify Docs Build needs: pre-commit - # inheriting secrets does not work for forked repos + # inherited secrets are not exposed to forked repos if: ${{ github.event.pull_request.head.repo.owner.login == 'beeware' }} uses: ./.github/workflows/docs-build-verify.yml secrets: inherit @@ -36,12 +36,12 @@ jobs: project-version: ${{ matrix.version }} strategy: matrix: - name: [ "briefcase", "toga" ] + name: [ briefcase, toga ] include: - - name: "briefcase" - version: "v0.3.13" - - name: "toga" - version: "v0.3.1" + - name: briefcase + version: v0.3.13 + - name: toga + version: v0.3.1 test-install-briefcase: name: Install Briefcase @@ -154,15 +154,15 @@ jobs: strategy: fail-fast: false matrix: - repo: [ "briefcase", "gbulb", "Python-support-testbed", "rubicon-objc", "toga" ] + repo: [ briefcase, gbulb, Python-support-testbed, rubicon-objc, toga ] include: - - pre-commit-source: ".[dev]" + - pre-commit-source: .[dev] - repo: gbulb - pre-commit-source: "pre-commit" + pre-commit-source: pre-commit - repo: Python-support-testbed - pre-commit-source: "pre-commit" + pre-commit-source: pre-commit - repo: toga - pre-commit-source: "./core[dev]" + pre-commit-source: ./core[dev] test-package-python: name: Create Package @@ -171,22 +171,27 @@ jobs: with: repository: beeware/${{ matrix.repo }} tox-source: ${{ matrix.tox-source }} + tox-factors: ${{ matrix.tox-factors }} distribution-path: ${{ matrix.dist-path }} build-subdirectory: ${{ matrix.build-subdir }} strategy: fail-fast: false matrix: - repo: [ "briefcase", "gbulb", "rubicon-objc", "toga" ] + repo: [ briefcase, gbulb, rubicon-objc, toga ] include: - - tox-source: ".[dev]" - - dist-path: "dist" - - repo: "gbulb" - tox-source: "tox" - dist-path: "dist" - - repo: "toga" - tox-source: "./core[dev]" + - tox-source: .[dev] + - dist-path: dist + - repo: briefcase + tox-source: .[dev] + tox-factors: -with-automation + dist-path: dist + - repo: gbulb + tox-source: tox + dist-path: dist + - repo: toga + tox-source: ./core[dev] dist-path: "*/dist/*" - build-subdir: "core" + build-subdir: core test-verify-projects-briefcase: name: Verify Project @@ -199,8 +204,8 @@ jobs: strategy: fail-fast: false matrix: - framework: [ "toga", "pyside6" ] - runner-os: [ "macos-latest", "windows-latest", "ubuntu-22.04" ] + framework: [ toga, pyside6 ] + runner-os: [ macos-latest, windows-latest, ubuntu-22.04 ] test-verify-apps-briefcase: name: Verify Briefcase @@ -214,8 +219,8 @@ jobs: strategy: fail-fast: false matrix: - framework: [ "toga", "ppb" ] - runner-os: [ "macos-latest", "windows-latest", "ubuntu-22.04" ] + framework: [ toga, ppb ] + runner-os: [ macos-latest, windows-latest, ubuntu-22.04 ] test-verify-apps-briefcase-template: name: Verify Briefcase Template @@ -229,8 +234,8 @@ jobs: strategy: fail-fast: false matrix: - framework: [ "toga", "ppb" ] - runner-os: [ "macos-latest", "windows-latest", "ubuntu-latest" ] + framework: [ toga, ppb ] + runner-os: [ macos-latest, windows-latest, ubuntu-latest ] test-verify-apps-android-templates: name: Verify Android @@ -242,11 +247,12 @@ jobs: runner-os: ${{ matrix.runner-os }} target-platform: android target-format: gradle - framework: toga + framework: ${{ matrix.framework }} strategy: fail-fast: false matrix: - runner-os: [ "macos-latest", "windows-latest", "ubuntu-latest" ] + framework: [ toga ] # toga only + runner-os: [ macos-latest, windows-latest, ubuntu-latest ] test-verify-apps-iOS-templates: name: Verify iOS @@ -258,16 +264,18 @@ jobs: runner-os: macos-latest target-platform: iOS target-format: xcode - framework: toga + framework: ${{ matrix.framework }} + strategy: + fail-fast: false + matrix: + framework: [ toga ] # toga only test-verify-apps-linux-system-templates: - name: Verify Linux System + name: Verify Linux needs: pre-commit uses: ./.github/workflows/app-build-verify.yml with: - # This *must* be the version of Python that is the system Python on ubuntu-22.04. - # Otherwise native system package builds won't be included. - python-version: "3.10" + python-version: "3.10" # must match system python for ubuntu version repository: beeware/briefcase-linux-system-template runner-os: ubuntu-22.04 target-platform: linux @@ -276,7 +284,7 @@ jobs: strategy: fail-fast: false matrix: - framework: [ "toga", "ppb" ] + framework: [ toga, pyside6, ppb, pygame ] test-verify-apps-appimage-templates: name: Verify AppImage @@ -288,7 +296,11 @@ jobs: runner-os: ubuntu-latest target-platform: linux target-format: appimage - framework: toga + framework: ${{ matrix.framework }} + strategy: + fail-fast: false + matrix: + framework: [ toga, pyside6, ppb, pygame ] test-verify-apps-flatpak-templates: name: Verify Flatpak @@ -304,7 +316,7 @@ jobs: strategy: fail-fast: false matrix: - framework: [ "toga", "pygame" ] + framework: [ toga, pyside6, ppb, pygame ] test-verify-apps-macOS-templates: name: Verify macOS @@ -320,8 +332,8 @@ jobs: strategy: fail-fast: false matrix: - format: [ "app", "Xcode" ] - framework: [ "toga", "ppb" ] + framework: [ toga, pyside6, ppb, pygame ] + format: [ app, Xcode ] test-verify-apps-web-templates: name: Verify Web @@ -333,7 +345,11 @@ jobs: runner-os: ubuntu-latest target-platform: web target-format: static - framework: toga + framework: ${{ matrix.framework }} + strategy: + fail-fast: false + matrix: + framework: [ toga ] # toga only test-verify-apps-windows-templates: name: Verify Windows @@ -349,5 +365,5 @@ jobs: strategy: fail-fast: false matrix: - format: [ "app", "VisualStudio" ] - framework: [ "toga", "ppb" ] + framework: [ toga, pyside6, ppb, pygame ] + format: [ app, VisualStudio ] diff --git a/.github/workflows/python-package-create.yml b/.github/workflows/python-package-create.yml index 5f0f2dc0..28bd3617 100644 --- a/.github/workflows/python-package-create.yml +++ b/.github/workflows/python-package-create.yml @@ -19,6 +19,10 @@ on: description: "The arguments for `pip install` to install tox; use ./path/to/package[dev] for the repo's pinned version." default: ".[dev]" type: string + tox-factors: + description: "The tox factors to append to the package command." + default: "" + type: string build-subdirectory: description: "The subdirectory to build as a wheel." default: "" @@ -74,11 +78,11 @@ jobs: - name: Build wheels if: inputs.build-subdirectory == '' - run: tox -e package + run: tox -e package${{ inputs.tox-factors }} - name: Build wheels from subdirectory if: inputs.build-subdirectory != '' - run: tox -e package -- ${{ inputs.build-subdirectory }} + run: tox -e package${{ inputs.tox-factors }} -- ${{ inputs.build-subdirectory }} - name: Upload Package uses: actions/upload-artifact@v3.1.3 From c3c299b88328e4583d0c2b6271c9bf976b6cb5ca Mon Sep 17 00:00:00 2001 From: Russell Martin Date: Mon, 4 Dec 2023 20:39:06 -0500 Subject: [PATCH 2/2] Limit `install-briefcase` action testing to post v0.3.16 --- .github/workflows/ci.yml | 55 ++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 479aedab..d70128d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,7 @@ jobs: version: v0.3.1 test-install-briefcase: + # TODO: restore commented tests once Briefcase v0.3.17 is released name: Install Briefcase needs: pre-commit runs-on: ubuntu-latest @@ -52,61 +53,53 @@ jobs: fail-fast: false matrix: test-case: - - "v0.3.12" - "main" - "PR Repo & Ref" - "PR Repo & Ref (irregular)" - - "PR Ref" - - "refs/tags/v0.3.11" + #- "PR Ref" + #- "refs/tags/v0.3.17" - "refs/tags/v40.0.5" - - "refs/heads/v0.3.10" + #- "refs/heads/v0.3.17" - "refs/heads/v40.0.5" - - "refs/pull/v0.3.9" + #- "refs/pull/v0.3.17" - "refs/pull/v40.0.5" include: # Test override logic - - test-case: "v0.3.12" - version: "v0.3.12" - expected: "v0.3.12" - test-case: "main" version: "main" expected: "main" # Test PR body override - test-case: "PR Repo & Ref" - testing-pr-body: "sadf asdf BRIEFCASE_REPO: https://github.com/freakboy3742/briefcase.git xcvbwer BRIEFCASE_REF: 3470d95 xczvb https://example.com/asdf?q=repo%3Aindygreg%2" - expected: "3470d95" + testing-pr-body: "sadf asdf BRIEFCASE_REPO: https://github.com/freakboy3742/briefcase.git xcvbwer BRIEFCASE_REF: 19215d9 xczvb https://example.com/asdf?q=repo%3Aindygreg%2" + expected: "19215d9" - test-case: "PR Repo & Ref (irregular)" - testing-pr-body: "sadf asdf BrIeFcAsE__REpo: https://github.com/freakboy3742/briefcase.git xcvbwer BRIEFcaseREF:3470d95 xczvb https://example.com/asdf?q=repo%3Aindygreg%2" - expected: "3470d95" - - test-case: "PR Ref" - testing-pr-body: "sadf asdf BRIEFcaseREF: v0.3.12" - expected: "v0.3.12" + testing-pr-body: "sadf asdf BrIeFcAsE__REpo: https://github.com/freakboy3742/briefcase.git xcvbwer BRIEFcaseREF:19215d9 xczvb https://example.com/asdf?q=repo%3Aindygreg%2" + expected: "19215d9" + #- test-case: "PR Ref" + # testing-pr-body: "sadf asdf BRIEFcaseREF: v0.3.17" + # expected: "v0.3.17" # Test version derivation for Releases - - test-case: "refs/tags/v0.3.11" - testing-trigger-ref: "refs/tags/v0.3.11" - testing-ref-name: "v0.3.11" - expected: "v0.3.11" + #- test-case: "refs/tags/v0.3.17" + # testing-trigger-ref: "refs/tags/v0.3.17" + # testing-ref-name: "v0.3.17" + # expected: "v0.3.11" - test-case: "refs/tags/v40.0.5" testing-trigger-ref: "refs/tags/v40.0.5" testing-ref-name: "v40.0.5" expected: "main" - - test-case: "refs/heads/v0.3.10" - testing-trigger-ref: "refs/heads/v0.3.10" - testing-ref-name: "v0.3.10" - expected: "v0.3.10" + #- test-case: "refs/heads/v0.3.17" + # testing-trigger-ref: "refs/heads/v0.3.17" + # testing-ref-name: "v0.3.17" + # expected: "v0.3.17" - test-case: "refs/heads/v40.0.5" testing-trigger-ref: "refs/heads/v40.0.5" testing-ref-name: "v40.0.5" expected: "main" # Test version derivation for PRs - - test-case: "refs/pull/v0.3.9" - testing-trigger-ref: "refs/pull/18/merge" - testing-pr-ref: "refs/heads/v0.3.9" - expected: "v0.3.9" - - test-case: "refs/pull/v0.3.9" - testing-trigger-ref: "refs/pull/20/merge" - testing-pr-ref: "v0.3.9" - expected: "v0.3.9" + #- test-case: "refs/pull/v0.3.17" + # testing-trigger-ref: "refs/pull/18/merge" + # testing-pr-ref: "refs/heads/v0.3.17" + # expected: "v0.3.17" - test-case: "refs/pull/v40.0.5" testing-trigger-ref: "refs/pull/25/merge" testing-pr-ref: "v40.0.5"