-
-
Notifications
You must be signed in to change notification settings - Fork 7
74 lines (65 loc) · 2.1 KB
/
Copy pathci.yml
File metadata and controls
74 lines (65 loc) · 2.1 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
name: CI
on:
[pull_request]
jobs:
build-test:
runs-on: ubuntu-latest
env:
KEYMANHOSTS_TIER: TIER_TEST
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
#
# Finally, run the tests
#
- name: PHP test
shell: bash
run: |
docker exec keyman-com-app sh -c "vendor/bin/phpunit --testdox"
- name: Lint
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]} )
- name: Check broken links
shell: bash
continue-on-error: false
run: |
set +e
set +o pipefail
readarray -t ignoresArray <<< $(find ./_includes/locale/strings/keyboards/ -maxdepth 1 -name '*.php' ! -name "en.php" \
-execdir basename {} .php ';')
baseURL="http://localhost:8053"
ignoreStr=(" --exclude ${baseURL}*downloads/releases/*")
for locale in "${ignoresArray[@]}"; do
ignoreStr+=" --exclude ${baseURL}/${locale}/*"
done
echo "ignoreStr: ${ignoreStr[@]}"
npx broken-link-checker ${baseURL}/_test --recursive --ordered ---host-requests 50 -e --filter-level 3 ${ignoreStr} | tee blc.log
echo "BLC_RESULT=${PIPESTATUS[0]}" >> "$GITHUB_ENV"
- name: Report on broken links
run: |
set +e
set +o pipefail
cat blc.log | \
grep -E "BROKEN|Getting links from" | \
grep -B 1 "BROKEN";
exit "${BLC_RESULT}"
- name: Check PHP errors
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'
exit 1
else
echo 'No PHP errors found'
exit 0
fi