-
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 2.46 KB
/
Copy pathci.yml
File metadata and controls
78 lines (68 loc) · 2.46 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
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
# Build the docker image
- name: Build the Docker image
shell: bash
run: |
echo "TIER_TEST" > tier.txt
./build.sh build start
env:
fail-fast: true
#
# Finally, run the tests; note that this is almost all replicated in build.sh; here logging is reduced (TODO sync)
#
- 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]} )
# Link checker not needed. No html files to verify
- 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
- name: Check static file generated
shell: bash
run: |
pwd
if [ ! -f ./metadata/kmwversions.json ]; then
echo "Failed to generate static file"
exit 1
fi
#
# If any of the tests fail, let's grab a bit more detail on the environment
#
- name: Report errors
if: ${{ failure() }}
shell: bash
run: |
CONTAINER=`docker container ls -l -q`
echo "--- PHP errors in Docker log ---"
docker container logs $CONTAINER 2>&1 | grep 'php7'
- 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
)