diff --git a/.github/workflows/web_app.yml b/.github/workflows/web_app.yml new file mode 100644 index 0000000..c57bcea --- /dev/null +++ b/.github/workflows/web_app.yml @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c3004b..8fe5363 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/environment/cmake/FindFlet.cmake b/environment/cmake/FindFlet.cmake new file mode 100644 index 0000000..ba8d12c --- /dev/null +++ b/environment/cmake/FindFlet.cmake @@ -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 +) diff --git a/source/package/pathways_app/CMakeLists.txt b/source/package/pathways_app/CMakeLists.txt index f5f4a30..88bf2cc 100644 --- a/source/package/pathways_app/CMakeLists.txt +++ b/source/package/pathways_app/CMakeLists.txt @@ -1,6 +1,3 @@ -find_program(AP_FLET_COMMAND flet REQUIRED) - - configure_file( pyproject.toml.in pyproject.toml @@ -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:"