-
-
Notifications
You must be signed in to change notification settings - Fork 7
97 lines (84 loc) · 3 KB
/
Copy pathci.yml
File metadata and controls
97 lines (84 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: CI
on:
[pull_request]
jobs:
build-test:
runs-on: ubuntu-latest
env:
KEYMANHOSTS_TIER: TIER_TEST
CONTAINER_DESC: keyman-com-app
CONTAINER_PORT: 8053
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Build the docker image for keyman.com app
shell: bash
run: |
echo "TIER_TEST" > tier.txt
./build.sh configure build start --debug
env:
fail-fast: true
#
# Run tests -- these step definitions are NEARLY identical across:
# help.keyman.com, keyman.com, keymanweb.com, api.keyman.com
#
# Difference: testPath and skipPaths are different for do_test_links 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: |
source ./_common/tests.inc.sh
set -e
do_test_unit_tests "$CONTAINER_DESC"
- name: Lint
if: ${{ !cancelled() }}
shell: bash
run: |
source ./_common/tests.inc.sh
set -e
do_test_lint "$CONTAINER_DESC"
- name: Check broken links
if: ${{ !cancelled() }}
shell: bash
run: |
source ./_common/tests.inc.sh
set -e
# following two lines match do_test_docker_container in build.sh
ignoreLocales="$(jq -r 'keys | map(select(. != "en")) | join("|")' ./_includes/locale/locales.json)"
do_test_links "http://localhost:${CONTAINER_PORT}" "/_test" "/(${ignoreLocales})" "/en/downloads/releases/"
# 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: |
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: |
# 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
)