Skip to content

Commit

Permalink
Merge pull request #54 from drewbrew/add-ci
Browse files Browse the repository at this point in the history
Add CI
  • Loading branch information
freakboy3742 authored Oct 20, 2022
2 parents eb13ce8 + d476ebe commit b2dfee2
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI
on:
pull_request:
push:
branches:
- main
workflow_call:

env:
python_version: "3.9"

defaults:
run:
shell: bash # https://github.com/beeware/briefcase/pull/912

jobs:
verify-apps:
name: Build apps
strategy:
matrix:
os_name: ["macOS", "windows", "linux"]
framework: ["toga"]
include:
- os_name: macOS
platform: macos-12
briefcase-data-dir: ~/Library/Caches/org.beeware.briefcase
pip-cache-dir: ~/Library/Caches/pip
docker-cache-dir: ~/Library/Containers/com.docker.docker/Data/vms/0/
- os_name: windows
platform: windows-latest
briefcase-data-dir: ~\AppData\Local\BeeWare\briefcase\Cache
pip-cache-dir: ~\AppData\Local\pip\Cache
docker-cache-dir: C:\ProgramData\DockerDesktop
- os_name: linux
# Need to use at least 22.04 to get the bugfix in flatpak for handling spaces in filenames.
platform: ubuntu-22.04
briefcase-data-dir: ~/.cache/briefcase
pip-cache-dir: ~/.cache/pip
# cache action cannot cache docker images (actions/cache#31)
# docker-cache-dir: /var/lib/docker
runs-on: ${{ matrix.platform }}
steps:
- name: Cache Briefcase tools
uses: actions/[email protected]
with:
key: briefcase-${{ matrix.platform }}
path: |
~/.cookiecutters
${{ matrix.briefcase-data-dir }}
${{ matrix.pip-cache-dir }}
${{ matrix.docker-cache-dir }}
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ env.python_version }}
- name: Install packages
run: pip install briefcase
- name: Build Android App
run: |
cd tests/apps/verify-${{ matrix.framework }}
briefcase create android
briefcase build android
briefcase package android --adhoc-sign
22 changes: 22 additions & 0 deletions tests/apps/verify-toga/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[tool.briefcase]
project_name = "Hello Toga"
bundle = "org.beeware"
version = "0.0.1"
url = "https://beeware.org/"
license = "BSD license"
author = 'Brutus'
author_email = "[email protected]"

[tool.briefcase.app.verify-toga]
formal_name = "Hello Toga"
description = "A Toga test app"
icon = "src/verify_toga/resources/verify-toga"
sources = ['src/verify_toga']
requires = [
]

[tool.briefcase.app.verify-toga.android]
requires = [
'toga-android>=0.3.0.dev38'
]
template = "../../.."
Empty file.
4 changes: 4 additions & 0 deletions tests/apps/verify-toga/src/verify_toga/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from verify_toga.app import main

if __name__ == '__main__':
main().main_loop()
27 changes: 27 additions & 0 deletions tests/apps/verify-toga/src/verify_toga/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
A Toga test app
"""
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW


class HelloToga(toga.App):

def startup(self):
"""
Construct and show the Toga application.
Usually, you would add your application to a main content box.
We then create a main window (with a name matching the app), and
show the main window.
"""
main_box = toga.Box()

self.main_window = toga.MainWindow(title=self.formal_name)
self.main_window.content = main_box
self.main_window.show()


def main():
return HelloToga()
Empty file.
Binary file not shown.

0 comments on commit b2dfee2

Please sign in to comment.