Skip to content

Commit

Permalink
Merge pull request #59 from geoneric/gh58
Browse files Browse the repository at this point in the history
Add generation of the web app to a GH workflow
  • Loading branch information
kordejong authored Jan 17, 2025
2 parents 8c58c89 + bc7b88c commit 6754bb5
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 4 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/web_app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Web app

on:
pull_request:
push:

jobs:
build:
name: ${{ matrix.platform.os }} / ${{ matrix.platform.arch }} / python-${{ matrix.python_version }}
runs-on: ${{ matrix.platform.os }}
timeout-minutes: 30
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
python_version: ["3.12"]
platform:
- { os: "ubuntu-24.04", arch: x64 }
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
cache: "pip"
cache-dependency-path: "**/requirements*.txt"
- name: Install Python packages
run: |
pip install -r environment/configuration/requirements.txt -r environment/configuration/requirements-dev.txt
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.24.5"
channel: "stable"
cache: true
- name: Create web app
run: |
mkdir build
cd build
cmake -S .. -G Ninja
cmake --build . --target web_app
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enable_testing()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/environment/cmake)

find_package(CairoSVG REQUIRED)
find_package(Flet REQUIRED)
find_package(PyInstaller REQUIRED)
find_package(Python3 REQUIRED COMPONENTS Interpreter)
find_package(QtTools)
Expand Down
13 changes: 13 additions & 0 deletions environment/cmake/FindFlet.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
find_program(Flet_EXECUTABLE
NAMES flet
)

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(Flet DEFAULT_MSG
Flet_EXECUTABLE
)

mark_as_advanced(
Flet_EXECUTABLE
)
5 changes: 1 addition & 4 deletions source/package/pathways_app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
find_program(AP_FLET_COMMAND flet REQUIRED)


configure_file(
pyproject.toml.in
pyproject.toml
Expand All @@ -13,7 +10,7 @@ add_custom_target(web_app
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
COMMAND
${CMAKE_COMMAND} -E env "PIP_FIND_LINKS=file://${PROJECT_BINARY_DIR}/dist"
${AP_FLET_COMMAND} build web ${CMAKE_CURRENT_BINARY_DIR}
${Flet_EXECUTABLE} build web ${CMAKE_CURRENT_BINARY_DIR}
COMMAND
${CMAKE_COMMAND} -E echo
"Run a command like this to start the web app:"
Expand Down

0 comments on commit 6754bb5

Please sign in to comment.