Merge pull request #85 from beeware/dependabot/github_actions/actions… #244
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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_call: | |
# Cancel active CI runs for a PR before starting another run | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
env: | |
FORCE_COLOR: "1" | |
jobs: | |
pre-commit: | |
name: Pre-commit checks | |
uses: beeware/.github/.github/workflows/pre-commit-run.yml@main | |
with: | |
pre-commit-source: "pre-commit" | |
unit-tests: | |
name: Unit tests | |
needs: pre-commit | |
runs-on: ${{ matrix.runs-on }} | |
strategy: | |
fail-fast: false | |
matrix: | |
backend: | |
- "macOS-Xcode" | |
- "macOS-app" | |
# AppImage builds (a) take over an hour, because the need to compile Numpy and | |
# Pandas from source, and (b) are only here as a light validation that | |
# Standalone Python is working. A Flatpak build also validates this, but | |
# completes in minutes. | |
# - "linux-appimage" | |
- "linux-flatpak" | |
- "windows-VisualStudio" | |
- "windows-app" | |
- "iOS" | |
- "android" | |
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] | |
include: | |
- runs-on: ubuntu-latest | |
- pre-command: | |
- briefcase-target: | |
- briefcase-run-args: | |
- backend: macOS-Xcode | |
runs-on: macos-latest | |
briefcase-target: "macOS Xcode" | |
- backend: macOS-app | |
runs-on: macos-latest | |
briefcase-target: "macOS app" | |
- backend: linux-system | |
runs-on: ubuntu-latest | |
python-version: "system" | |
pre-command: "sudo apt update -y && sudo apt install -y --no-install-recommends python3-dev python3-pip libcairo2-dev libgirepository1.0-dev gir1.2-gtk-3.0" | |
briefcase-target: "linux system" | |
# - backend: linux-appimage | |
# runs-on: ubuntu-latest | |
# pre-command: "sudo apt update -y && sudo apt install -y --no-install-recommends libfuse2 libthai-dev libegl1" | |
# briefcase-target: "linux appimage" | |
- backend: linux-flatpak | |
runs-on: ubuntu-latest | |
pre-command: "sudo apt update -y && sudo apt install -y --no-install-recommends flatpak flatpak-builder elfutils" | |
briefcase-target: "linux flatpak" | |
- backend: windows-VisualStudio | |
runs-on: windows-latest | |
briefcase-target: "windows VisualStudio" | |
- backend: windows-app | |
runs-on: windows-latest | |
briefcase-target: "windows app" | |
- backend: iOS | |
runs-on: macos-latest | |
briefcase-target: "iOS" | |
briefcase-run-args: ' -d "iPhone SE (3rd generation)"' | |
- backend: android | |
runs-on: "ubuntu-latest" | |
briefcase-target: "android" | |
briefcase-run-args: > | |
--device '{"avd":"beePhone"}' | |
--Xemulator=-no-window | |
--Xemulator=-no-snapshot | |
--Xemulator=-no-audio | |
--Xemulator=-no-boot-anim | |
--shutdown-on-exit | |
pre-command: | | |
# 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 | |
exclude: | |
# Binary packages aren't available for 3.11+ on Android yet | |
- backend: "android" | |
python-version: "3.11" | |
- backend: "android" | |
python-version: "3.12" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.7 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5.1.1 | |
if: matrix.python-version != 'system' | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: ${{ matrix.pre-command }} | |
- name: Install Briefcase | |
uses: beeware/.github/.github/actions/install-briefcase@main | |
- name: Test App | |
run: briefcase run ${{ matrix.briefcase-target }} --test ${{ matrix.briefcase-run-args }} | |
- name: Package | |
run: briefcase package ${{ matrix.briefcase-target }} --update --adhoc-sign | |
- name: Upload Logs | |
uses: actions/upload-artifact@v4.3.4 | |
if: failure() | |
with: | |
name: build-failure-logs-${{ matrix.backend }}-${{ matrix.python-version }} | |
path: logs/* |