@@ -5,21 +5,90 @@ on: [pull_request]
55jobs :
66 build-test :
77 runs-on : ubuntu-latest
8+ env :
9+ KEYMANHOSTS_TIER : TIER_TEST
10+ CONTAINER_DESC : api-keyman-com-app
11+ CONTAINER_PORT : 8058
812
913 steps :
1014 - name : Checkout
1115 uses : actions/checkout@v6.0.2
1216
17+ # Build the docker image and create link to vendor/ dependencies
1318 - name : Build the Docker image
1419 shell : bash
1520 run : |
1621 echo "TIER_TEST" > tier.txt
17- ./build.sh build start
22+ ./build.sh configure build start --debug
1823 env :
1924 fail-fast : true
2025
21- - name : Run tests
26+ #
27+ # Run tests -- these step definitions are NEARLY identical across:
28+ # help.keyman.com, keyman.com, keymanweb.com, api.keyman.com
29+ #
30+ # No differences on this site
31+ #
32+ - name : Test setup
2233 shell : bash
2334 run : |
24- ./build.sh test
35+ source ./_common/tests.inc.sh
36+ set -e
37+ do_test_record_start_time
38+ echo "TEST_START_TIME=${TEST_START_TIME}" >> "$GITHUB_ENV"
2539
40+ - name : PHP test
41+ if : ${{ !cancelled() }}
42+ shell : bash
43+ run : |
44+ source ./_common/tests.inc.sh
45+ set -e
46+ do_test_unit_tests "$CONTAINER_DESC"
47+
48+ - name : Lint
49+ if : ${{ !cancelled() }}
50+ shell : bash
51+ run : |
52+ source ./_common/tests.inc.sh
53+ set -e
54+ do_test_lint "$CONTAINER_DESC"
55+
56+ - name : Check broken links
57+ if : ${{ !cancelled() }}
58+ shell : bash
59+ run : |
60+ source ./_common/tests.inc.sh
61+ set -e
62+ do_test_links "http://localhost:${CONTAINER_PORT}" /
63+
64+ # We split the reporting of broken links into a separate step for ease of
65+ # viewing because the broken links are otherwise hidden in a sea of good
66+ # links in a very long report
67+
68+ - name : Report on broken links
69+ if : ${{ !cancelled() }}
70+ run : |
71+ source ./_common/tests.inc.sh
72+ set -e
73+ do_test_print_link_report
74+
75+ - name : Check PHP errors
76+ if : ${{ !cancelled() }}
77+ shell : bash
78+ run : |
79+ source ./_common/tests.inc.sh
80+ set -e
81+ do_test_print_container_error_logs "$CONTAINER_DESC"
82+
83+ - name : Verify .bootstrap-required-version
84+ if : ${{ !cancelled() }}
85+ shell : bash
86+ run : |
87+ # We want to avoid merging a bootstrap version that is not based on a published tag
88+ # in the shared-sites repo. We will do this with a heuristic based on the normal
89+ # shape of the tags, which is `v#.#.#`. Any other shape we will assume is a test
90+ # branch.
91+ cat resources/.bootstrap-required-version | grep -qP '^v\d+\.\d+\.\d+$' || (
92+ 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?"
93+ exit 1
94+ )
0 commit comments