Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 51 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
runs-on: ubuntu-latest
env:
KEYMANHOSTS_TIER: TIER_TEST
CONTAINER_DESC: help-keyman-com-app
CONTAINER_PORT: 8055

steps:
- name: Checkout
Expand All @@ -23,45 +25,71 @@ jobs:
fail-fast: true

#
# Finally, run the tests; note that this is almost all replicated in build.sh; here logging is reduced (TODO sync)
# Run tests -- these step definitions are NEARLY identical across:
# help.keyman.com, keyman.com, keymanweb.com, api.keyman.com
#
- name: PHP unit tests
# No differences on this site
#
- name: Test setup
shell: bash
run: |
source ./_common/tests.inc.sh
set -e
do_test_record_start_time
echo "TEST_START_TIME=${TEST_START_TIME}" >> "$GITHUB_ENV"

- name: PHP test
if: ${{ !cancelled() }}
shell: bash
run: |
docker exec help-keyman-com-app sh -c "vendor/bin/phpunit --testdox"
source ./_common/tests.inc.sh
set -e
do_test_unit_tests "$CONTAINER_DESC"

- name: Lint
if: ${{ !cancelled() }}
shell: bash
run: |
( set +e; set +o pipefail; find . -name '*.php' | grep -v '/vendor/' | xargs -n 1 -d '\n' php -l | grep -v "No syntax errors detected"; exit ${PIPESTATUS[2]} )
source ./_common/tests.inc.sh
set -e
do_test_lint "$CONTAINER_DESC"

- name: Check broken links
if: ${{ !cancelled() }}
shell: bash
continue-on-error: false
run: |
set +e
set +o pipefail
npx broken-link-checker http://localhost:8055 --ordered --recursive --host-requests 50 -e --filter-level 3 | tee blc.log
echo "BLC_RESULT=${PIPESTATUS[0]}" >> "$GITHUB_ENV"
source ./_common/tests.inc.sh
set -e
do_test_links "http://localhost:${CONTAINER_PORT}" /

# We split the reporting of broken links into a separate step for ease of
# viewing because the broken links are otherwise hidden in a sea of good
# links in a very long report

- name: Report on broken links
if: ${{ !cancelled() }}
run: |
set +e
set +o pipefail
cat blc.log | \
grep -E "BROKEN|Getting links from" | \
grep -B 1 "BROKEN";
exit "${BLC_RESULT}"
source ./_common/tests.inc.sh
set -e
do_test_print_link_report

- name: Check PHP errors
if: ${{ !cancelled() }}
shell: bash
run: |
source ./_common/tests.inc.sh
set -e
do_test_print_container_error_logs "$CONTAINER_DESC"

- name: Verify .bootstrap-required-version
if: ${{ !cancelled() }}
shell: bash
run: |
CONTAINER=`docker container ls -l -q`
if docker container logs $CONTAINER 2>&1 | grep -q 'php7'; then
echo 'PHP reported errors or warnings:'
docker container logs $CONTAINER 2>&1 | grep 'php7'
# We want to avoid merging a bootstrap version that is not based on a published tag
# in the shared-sites repo. We will do this with a heuristic based on the normal
# shape of the tags, which is `v#.#.#`. Any other shape we will assume is a test
# branch.
cat resources/.bootstrap-required-version | grep -qP '^v\d+\.\d+\.\d+$' || (
echo "::error file=resources/.bootstrap-required-version,line=1,col=1::This branch cannot be merged, because resources/.bootstrap-required-version references \`$(cat resources/.bootstrap-required-version)\`, which does not appear to be a published tag -- is it a test branch?"
exit 1
else
echo 'No PHP errors found'
exit 0
fi
)
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cdn/deploy
tier.txt

# unit test artifacts
blc.log
linkinator-results.json
.phpunit.result.cache

vendor*
Expand All @@ -24,4 +24,4 @@ _control/debug

# Cache of keyboard metadata, deleted on site rebuild
keyboard/index.cache
.phpunit.result.cache
.phpunit.result.cache
39 changes: 6 additions & 33 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
## START STANDARD SITE BUILD SCRIPT INCLUDE
readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh"
readonly BOOTSTRAP_VERSION=v1.0.14
BOOTSTRAP_VERSION="$(cat "$(dirname "THIS_SCRIPT")/resources/.bootstrap-required-version")" || exit 1
readonly BOOTSTRAP_VERSION
if ! [ -f "$BOOTSTRAP" ] || ! source "$BOOTSTRAP"; then
curl -H "Cache-Control: no-cache" --fail --silent --show-error -w "curl: Finished attempt to download %{url}" "https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh" -o "$BOOTSTRAP.tmp" || exit 1
source "$BOOTSTRAP.tmp"
Expand All @@ -29,44 +30,16 @@ builder_describe \
start \
stop \
test \
"--no-unit-test" \
"--no-lint" \
"--no-link-check"

builder_parse "$@"

function test_docker_container() {
# Note: ci.yml replicates these

echo "TIER_TEST" > tier.txt
set +e;
set +o pipefail;

builder_echo blue "---- PHP unit tests"
docker exec $HELP_CONTAINER_DESC sh -c "vendor/bin/phpunit --testdox"

# Lint .php files for obvious errors
builder_echo blue "---- Lint PHP files"
docker exec $HELP_CONTAINER_DESC sh -c "find . -name '*.php' | grep -v '/vendor/' | xargs -n 1 -d '\\n' php -l"

# Check all internal links
# NOTE: link checker runs on host rather than in docker image
builder_echo blue "---- Testing links"
npx broken-link-checker http://localhost:8055 --recursive --ordered ---host-requests 50 -e --filter-level 3 | tee blc.log
local BLC_RESULT=${PIPESTATUS[0]}
echo ----------------------------------------------------------------------
echo Link check summary
echo ----------------------------------------------------------------------
cat blc.log | \
grep -E "BROKEN|Getting links from" | \
grep -B 1 "BROKEN";

builder_echo blue "Done checking links"
rm tier.txt
return "${BLC_RESULT}"
}

builder_run_action configure bootstrap_configure
builder_run_action clean clean_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME
builder_run_action stop stop_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME
builder_run_action build build_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME $BUILDER_CONFIGURATION
builder_run_action start start_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME $HELP_CONTAINER_DESC $HOST_HELP_KEYMAN_COM $PORT_HELP_KEYMAN_COM $BUILDER_CONFIGURATION

builder_run_action test test_docker_container
builder_run_action test test_docker_container $HELP_CONTAINER_DESC $PORT_HELP_KEYMAN_COM /
10 changes: 5 additions & 5 deletions keyboard/buhid/1.0/buhid.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php
<?php
$pagename = 'Buhid Keyboard Help';
$pagetitle = $pagename;
// Header we will tidy up later
// Header we will tidy up later
require_once('header.php');
?>


<p class="p1"> Basic Buhid <span style="font-family: Noto Sans Buhid">(ᝊᝓᝑᝒ)</span> Keyboard for Philippines languages, included Tagalog, Buhid, etc. This keyboard covered all Buhid characters on the <a href="http://www.unicode.org/charts/PDF/U1740.pdf">Unicode Standard 13.0</a>. Other additional characters can be included in the future if necesarry. There is no standard keyboard layout yet for the Buhid Keyboard at the moment, so this keyboard can be one of the alternative options.</p>

<p class="p1">This keyboard layout designed based on suggestions from the user group in social media. I would like to thank to the admins of <a href="https://www.facebook.com/groups/1136372230134825/">Writing Script in the Philippines</a> on Facebook : John Andy Untalan Uy, Joliana Juan Sawal, Luke Biglang-Awa, Melgazar Galvan, Nathaniel Pønce de Leøn, & Raymond Bondoc Figueroa for their inputs. If there any other suggestions about the layout design, please let me know.</p>
<p class="p1">This keyboard layout designed based on suggestions from the user group in social media. I would like to thank to the admins of <a href="https://www.facebook.com/groups/1136372230134825/">Writing Script in the Philippines</a> on Facebook : John Andy Untalan Uy, Joliana Juan Sawal, Luke Biglang-Awa, Melgazar Galvan, Nathaniel Pønce de Leøn, & Raymond Bondoc Figueroa for their inputs. If there any other suggestions about the layout design, please let me know.</p>

<p class="p1">The font used along with this keyboard is Noto Sans Buhid. In case you have not install it on your machine, you can simply download the font from the <a href="https://www.google.com/get/noto/">Google Noto website</a> and install it.</p>
<p class="p1">The font used along with this keyboard is Noto Sans Buhid. In case you have not install it on your machine, you can simply download the font from the <a href="https://www.google.com/get/noto/">Google Noto website</a> and install it.</p>

<h1>Keyboard Layout</h1>

Expand All @@ -23,5 +23,5 @@
<div id='osk-phone' data-states='default numeric'>
</div>

<p class="footer">This keyboard is part of the <a href="https://kairaga.com>Kairaga.com">Kairaga.com</a> keyboard development program. Please send your thoughts to <a href="mailto:info@kairaga.com">info@kairaga.com</a></p>
<p class="footer">This keyboard is part of the <a href="https://kairaga.com">Kairaga.com</a> keyboard development program. Please send your thoughts to <a href="mailto:info@kairaga.com">info@kairaga.com</a></p>

4 changes: 2 additions & 2 deletions keyboard/tengwar_quenya/1.1/tengwar_quenya.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<img src="keyboard_layout.png" alt="Keyboard Layout" srcset=""><br>
<img src="keyboard_layout_shifted.png" alt="Shift Keyboard Layout" srcset=""><br>
<img src="keyboard_layout_alt.png" alt="" srcset="Alt Keyboard Layout"><br>
<img src="keyboard_layout_alt.png" alt="Alt Keyboard Layout" srcset=""><br>
<img src="keyboard_layout_alt-shifted.png" alt="Alt-Shift Keyboard Layout" srcset=""><br>
<p>
This keyboard follows Dvorak for Programmers keyboard layout.
Expand All @@ -25,5 +25,5 @@
<img src="mobile_keyboard_layout.jpg" alt="Mobile Keyboard Layout" srcset=""><br>
<img src="mobile_layout_numbers.jpg" alt="Mobile Keyboard Layout (Numbers)" srcset="">
<p>
This keyboard uses the same layout as the desktop layout. While characters in desktop shift, alt and alt-shift are available at long press.
This keyboard uses the same layout as the desktop layout. While characters in desktop shift, alt and alt-shift are available at long press.
</p>
4 changes: 2 additions & 2 deletions keyboard/tengwar_quenya/1.2/tengwar_quenya.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<img src="keyboard_layout.png" alt="Keyboard Layout" srcset=""><br>
<img src="keyboard_layout_shifted.png" alt="Shift Keyboard Layout" srcset=""><br>
<img src="keyboard_layout_alt.png" alt="" srcset="Alt Keyboard Layout"><br>
<img src="keyboard_layout_alt.png" alt="Alt Keyboard Layout" srcset=""><br>
<img src="keyboard_layout_alt-shifted.png" alt="Alt-Shift Keyboard Layout" srcset=""><br>
<p>
This keyboard follows Dvorak for Programmers keyboard layout.
Expand All @@ -25,5 +25,5 @@
<img src="mobile_keyboard_layout.jpg" alt="Mobile Keyboard Layout" srcset=""><br>
<img src="mobile_layout_numbers.jpg" alt="Mobile Keyboard Layout (Numbers)" srcset="">
<p>
This keyboard uses the same layout as the desktop layout. While characters in desktop shift, alt and alt-shift are available at long press.
This keyboard uses the same layout as the desktop layout. While characters in desktop shift, alt and alt-shift are available at long press.
</p>
4 changes: 2 additions & 2 deletions keyboard/tengwar_quenya/1.3/tengwar_quenya.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<img src="keyboard_layout.png" alt="Keyboard Layout" srcset=""><br>
<img src="keyboard_layout_shifted.png" alt="Shift Keyboard Layout" srcset=""><br>
<img src="keyboard_layout_alt.png" alt="" srcset="Alt Keyboard Layout"><br>
<img src="keyboard_layout_alt.png" alt="Alt Keyboard Layout" srcset=""><br>
<img src="keyboard_layout_alt-shifted.png" alt="Alt-Shift Keyboard Layout" srcset=""><br>
<p>
This keyboard follows Dvorak for Programmers keyboard layout.
Expand All @@ -25,5 +25,5 @@
<img src="mobile_keyboard_layout.jpg" alt="Mobile Keyboard Layout" srcset=""><br>
<img src="mobile_layout_numbers.jpg" alt="Mobile Keyboard Layout (Numbers)" srcset="">
<p>
This keyboard uses the same layout as the desktop layout. While characters in desktop shift, alt and alt-shift are available at long press.
This keyboard uses the same layout as the desktop layout. While characters in desktop shift, alt and alt-shift are available at long press.
</p>
4 changes: 2 additions & 2 deletions keyboard/tengwar_quenya/1.4/tengwar_quenya.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<img src="keyboard_layout.png" alt="Keyboard Layout" srcset=""><br>
<img src="keyboard_layout_shifted.png" alt="Shift Keyboard Layout" srcset=""><br>
<img src="keyboard_layout_alt.png" alt="" srcset="Alt Keyboard Layout"><br>
<img src="keyboard_layout_alt.png" alt="Alt Keyboard Layout" srcset=""><br>
<img src="keyboard_layout_alt-shifted.png" alt="Alt-Shift Keyboard Layout" srcset=""><br>
<p>
This keyboard follows Dvorak for Programmers keyboard layout.
Expand All @@ -25,5 +25,5 @@
<img src="mobile_keyboard_layout.jpg" alt="Mobile Keyboard Layout" srcset=""><br>
<img src="mobile_layout_numbers.jpg" alt="Mobile Keyboard Layout (Numbers)" srcset="">
<p>
This keyboard uses the same layout as the desktop layout. While characters in desktop shift, alt and alt-shift are available at long press.
This keyboard uses the same layout as the desktop layout. While characters in desktop shift, alt and alt-shift are available at long press.
</p>
1 change: 1 addition & 0 deletions resources/.bootstrap-required-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.0.14