Skip to content

Commit

Permalink
Run apps created in app-build-verify
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartin16 committed Dec 4, 2023
1 parent c9b15cf commit f52e45e
Show file tree
Hide file tree
Showing 6 changed files with 221 additions and 154 deletions.
31 changes: 20 additions & 11 deletions .github/actions/app-create/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ inputs:
briefcase-template-branch:
description: "The git branch for the template to use to roll out the project."
required: false
enable-automation:
description: "Whether to create a project using the Briefcase Automation plugin."
default: "false" # all composite workflow inputs are of type string
testing-pr-body:
description: "Override value for body of PR; only for testing."
required: false
Expand Down Expand Up @@ -63,16 +66,18 @@ runs:
TEMPLATE_BRANCH=$(printf -- "--template-branch %q" "${{ steps.template-override.outputs.ref }}")
fi
# Map the requested GUI toolkit to the input that Briefcase expects
# Default to the input to accommodate arbitrary toolkits installed as plugins
case "$(tr '[:upper:]' '[:lower:]' <<< '${{ inputs.framework }}')" in
toga ) GUI_INPUT=1 ;;
pyside6 ) GUI_INPUT=2 ;;
ppb ) GUI_INPUT=3 ;;
pygame ) GUI_INPUT=4 ;;
* ) GUI_INPUT=${{ inputs.framework }} ;;
# Map GUI toolkit through case insensitivity
case "$(tr '[:upper:]' '[:lower:]' <<< "${{ inputs.framework }}")" in
toga ) BOOTSTRAP=Toga ;;
pyside6 ) BOOTSTRAP=PySide6 ;;
ppb ) BOOTSTRAP=PursuedPyBear ;;
pygame ) BOOTSTRAP=Pygame ;;
* ) BOOTSTRAP=${{ inputs.framework }} ;;
esac
# If enabled, use the Automation bootstrap
[ "${{ inputs.enable-automation }}" != "false" ] && BOOTSTRAP="${BOOTSTRAP} Automation"
ROOT_DIR="apps"
APP_NAME="Verify App"
APP_DIR="verifyapp"
Expand All @@ -84,10 +89,14 @@ runs:
rm -rf "${APP_DIR}"
# Roll out the project
printf "%s\n%s\n\n\n\n\n\n\n\n%s\n" "${APP_NAME}" "${APP_DIR}" "${GUI_INPUT}" \
| briefcase new ${TEMPLATE} ${TEMPLATE_BRANCH}
briefcase new --no-input ${TEMPLATE} ${TEMPLATE_BRANCH} \
-Q "formal_name=${APP_NAME}" \
-Q "app_name=${APP_DIR}" \
-Q "bootstrap=${BOOTSTRAP}"
echo "Rolled out project to ${APP_PATH} (${{ inputs.framework }}->${GUI_INPUT})"
echo "Rolled out project to ${APP_PATH}"
echo " > GUI Toolkit: ${{ inputs.framework }}"
echo " > Bootstrap: ${BOOTSTRAP}"
printf "::group::pyproject.toml\n%s\n::endgroup::\n" "$(cat "${APP_DIR}/pyproject.toml")"
printf "::group::app.py\n%s\n::endgroup::\n" "$(cat "${APP_DIR}/src/${APP_DIR}/app.py")"
echo "path=${APP_PATH}" >> ${GITHUB_OUTPUT}
6 changes: 5 additions & 1 deletion .github/actions/install-briefcase/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ runs:
REF="${{ steps.briefcase-override.outputs.ref || steps.briefcase-derived.outputs.version }}"
echo "Installing ${REPO}@${REF}"
python -m pip install -U "git+${REPO}@${REF}"
python -m pip install \
--upgrade \
--upgrade-strategy eager \
"git+${REPO}@${REF}" \
"git+${REPO}@${REF}#subdirectory=automation"
echo "Installed version: $(briefcase --version)"
echo "version=${REF}" >> ${GITHUB_OUTPUT}
Loading

0 comments on commit f52e45e

Please sign in to comment.