Add workflow call trigger and permissions for CoC rollout. #1175
This file contains hidden or 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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| FORCE_COLOR: "1" | |
| jobs: | |
| pre-commit: | |
| name: Pre-commit Checks | |
| uses: ./.github/workflows/pre-commit-run.yml | |
| with: | |
| pre-commit-source: -r requirements.txt | |
| test-docs-build-verify: | |
| name: Verify Docs Build | |
| needs: pre-commit | |
| # 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 | |
| with: | |
| project-name: ${{ matrix.name }} | |
| project-version: ${{ matrix.version }} | |
| strategy: | |
| matrix: | |
| name: [ briefcase, toga ] | |
| include: | |
| - name: briefcase | |
| version: v0.3.13 | |
| - name: toga | |
| version: v0.3.1 | |
| test-install-briefcase: | |
| name: Install Briefcase | |
| needs: pre-commit | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| test-case: | |
| - "main" | |
| - "PR Repo & Ref" | |
| - "PR Repo & Ref (irregular)" | |
| - "PR Ref" | |
| - "refs/tags/v0.3.17" | |
| - "refs/tags/v40.0.5" | |
| - "refs/heads/v0.3.17" | |
| - "refs/heads/v40.0.5" | |
| - "refs/pull/v0.3.17" | |
| - "refs/pull/v40.0.5" | |
| include: | |
| # Test override logic | |
| - 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: 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: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.17" | |
| testing-trigger-ref: "refs/tags/v0.3.17" | |
| testing-ref-name: "v0.3.17" | |
| expected: "v0.3.17" | |
| - 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.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.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" | |
| expected: "main" | |
| steps: | |
| - name: Checkout beeware/.github | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6.1.0 | |
| with: | |
| python-version: "3.x" | |
| cache: pip | |
| cache-dependency-path: | | |
| **/setup.cfg | |
| **/pyproject.toml | |
| .pre-commit-config.yaml | |
| - name: Install Briefcase | |
| id: briefcase | |
| uses: ./.github/actions/install-briefcase | |
| with: | |
| briefcase-override-version: ${{ matrix.version }} | |
| testing-pr-body: ${{ matrix.testing-pr-body }} | |
| testing-trigger-ref: ${{ matrix.testing-trigger-ref }} | |
| testing-pr-ref: ${{ matrix.testing-pr-ref }} | |
| testing-ref-name: ${{ matrix.testing-ref-name }} | |
| - name: Briefcase @ ${{ matrix.test-case }} | |
| run: | | |
| if [[ "${{ matrix.expected }}" != "${{ steps.briefcase.outputs.installed-version }}" ]]; then | |
| echo "installed-version: ${{ steps.briefcase.outputs.installed-version }}" | |
| echo "Found Briefcase version v$(briefcase -V)" | |
| echo "Expected Briefcase version ${{ matrix.expected }}" | |
| exit 1 | |
| fi | |
| test-pre-commit-run: | |
| name: Pre-commit | |
| needs: pre-commit | |
| uses: ./.github/workflows/pre-commit-run.yml | |
| with: | |
| repository: beeware/${{ matrix.repo }} | |
| pre-commit-source: ${{ matrix.pre-commit-source }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Test one repository for each way of installing pre-commit. | |
| repo: [ Python-support-testbed, rubicon-objc ] | |
| include: | |
| - repo: Python-support-testbed | |
| pre-commit-source: pre-commit | |
| - repo: rubicon-objc | |
| pre-commit-source: "--group pre-commit" | |
| test-package-python: | |
| name: Create Package | |
| needs: pre-commit | |
| uses: ./.github/workflows/python-package-create.yml | |
| with: | |
| repository: beeware/${{ matrix.repo || matrix.name }} | |
| build-subdirectory: ${{ matrix.build-subdir }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| name: | |
| - briefcase | |
| - briefcase-automation | |
| - rubicon-objc | |
| - toga-core | |
| - toga-android | |
| include: | |
| - name: briefcase-automation | |
| repo: briefcase | |
| build-subdir: automation | |
| - name: toga-core | |
| repo: toga | |
| build-subdir: core | |
| - name: toga-android | |
| repo: toga | |
| build-subdir: android | |
| test-verify-projects-briefcase: | |
| name: Verify Project | |
| needs: [ pre-commit, test-package-python ] | |
| uses: ./.github/workflows/app-create-verify.yml | |
| with: | |
| # Falls back to 3.x in called workflow if undefined | |
| python-version: ${{ startsWith(matrix.runner-os, 'ubuntu') && 'system' || '' }} | |
| repository: beeware/briefcase | |
| runner-os: ${{ matrix.runner-os }} | |
| framework: ${{ matrix.framework }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| framework: [ toga, pyside6 ] | |
| runner-os: [ macos-latest, windows-latest, ubuntu-24.04, ubuntu-24.04-arm ] | |
| test-verify-apps-briefcase: | |
| name: Verify Briefcase | |
| needs: [ pre-commit, test-package-python ] | |
| uses: ./.github/workflows/app-build-verify.yml | |
| with: | |
| # Falls back to 3.x in called workflow if undefined | |
| python-version: ${{ startsWith(matrix.runner-os, 'ubuntu') && 'system' || '' }} | |
| repository: beeware/briefcase | |
| runner-os: ${{ matrix.runner-os }} | |
| framework: ${{ matrix.framework }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| framework: [ toga ] | |
| runner-os: [ macos-15-intel, macos-latest, windows-latest, ubuntu-24.04, ubuntu-24.04-arm ] | |
| test-verify-apps-briefcase-template: | |
| name: Verify Briefcase Template | |
| needs: pre-commit | |
| uses: ./.github/workflows/app-build-verify.yml | |
| with: | |
| python-version: "3.11" # Explicitly test the python-version override | |
| repository: beeware/briefcase-template | |
| runner-os: ${{ matrix.runner-os }} | |
| framework: ${{ matrix.framework }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| framework: [ toga ] | |
| runner-os: [ macos-latest, windows-latest, ubuntu-24.04, ubuntu-24.04-arm ] | |
| test-verify-apps-android-templates: | |
| name: Verify Android | |
| needs: pre-commit | |
| uses: ./.github/workflows/app-build-verify.yml | |
| with: | |
| repository: beeware/briefcase-android-gradle-template | |
| runner-os: ${{ matrix.runner-os }} | |
| target-platform: android | |
| target-format: gradle | |
| framework: ${{ matrix.framework }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| framework: [ toga ] # toga only | |
| runner-os: [ macos-latest, windows-latest, ubuntu-24.04 ] | |
| test-verify-apps-iOS-templates: | |
| name: Verify iOS | |
| needs: pre-commit | |
| uses: ./.github/workflows/app-build-verify.yml | |
| with: | |
| repository: beeware/briefcase-iOS-xcode-template | |
| runner-os: macos-latest | |
| target-platform: iOS | |
| target-format: xcode | |
| framework: ${{ matrix.framework }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| framework: [ toga ] # toga only | |
| test-verify-apps-linux-system-templates: | |
| name: Verify Linux | |
| needs: pre-commit | |
| uses: ./.github/workflows/app-build-verify.yml | |
| with: | |
| # Ubuntu apps need to run on the system Python | |
| python-version: "system" | |
| repository: beeware/briefcase-linux-system-template | |
| runner-os: ${{ matrix.runner-os }} | |
| target-platform: linux | |
| target-format: system | |
| framework: ${{ matrix.framework }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| framework: [ toga, pyside6, pygame, console ] | |
| runner-os: [ ubuntu-24.04, ubuntu-24.04-arm ] | |
| # see app-build-verify.yml; AppImage testing was disabled sept 2024 | |
| # test-verify-apps-appimage-templates: | |
| # name: Verify AppImage | |
| # needs: pre-commit | |
| # uses: ./.github/workflows/app-build-verify.yml | |
| # with: | |
| # repository: beeware/briefcase-linux-appimage-template | |
| # runner-os: ${{ matrix.runner-os }} | |
| # target-platform: linux | |
| # target-format: appimage | |
| # framework: ${{ matrix.framework }} | |
| # strategy: | |
| # fail-fast: false | |
| # matrix: | |
| # # 2024-07-11 (beeware/briefcase#1908): pyside6 segfaults on AppImage start. | |
| # framework: [ toga, pygame, console ] | |
| test-verify-apps-flatpak-templates: | |
| name: Verify Flatpak | |
| needs: pre-commit | |
| uses: ./.github/workflows/app-build-verify.yml | |
| with: | |
| repository: beeware/briefcase-linux-flatpak-template | |
| runner-os: ${{ matrix.runner-os }} | |
| target-platform: linux | |
| target-format: flatpak | |
| framework: ${{ matrix.framework }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| framework: [ toga, pyside6, pygame, console ] | |
| runner-os: [ ubuntu-24.04, ubuntu-24.04-arm ] | |
| exclude: | |
| # The Pyside6 6.10 series wheels for ARM64 are tagged manylinux_2_39, | |
| # which is not compatible with 24.04. | |
| - framework: pyside6 | |
| runner-os: ubuntu-24.04-arm | |
| test-verify-apps-macOS-templates: | |
| name: Verify macOS | |
| needs: pre-commit | |
| uses: ./.github/workflows/app-build-verify.yml | |
| with: | |
| repository: beeware/briefcase-macos-${{ matrix.format }}-template | |
| runner-os: macos-latest | |
| target-platform: macOS | |
| target-format: ${{ matrix.format }} | |
| framework: ${{ matrix.framework }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| framework: [ toga, pyside6, pygame, console ] | |
| format: [ app, Xcode ] | |
| test-verify-apps-web-templates: | |
| name: Verify Web | |
| needs: pre-commit | |
| uses: ./.github/workflows/app-build-verify.yml | |
| with: | |
| repository: beeware/briefcase-web-static-template | |
| runner-os: ubuntu-24.04 | |
| target-platform: web | |
| target-format: static | |
| framework: ${{ matrix.framework }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| framework: [ toga ] # toga only | |
| test-verify-apps-windows-templates: | |
| name: Verify Windows | |
| needs: pre-commit | |
| uses: ./.github/workflows/app-build-verify.yml | |
| with: | |
| repository: beeware/briefcase-windows-${{ matrix.format }}-template | |
| runner-os: windows-latest | |
| target-platform: windows | |
| target-format: ${{ matrix.format }} | |
| framework: ${{ matrix.framework }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| framework: [ toga, pyside6, pygame, console ] | |
| format: [ app, VisualStudio ] |