Skip to content

feat: keymanweb new interfaces are done part 1 #67

feat: keymanweb new interfaces are done part 1

feat: keymanweb new interfaces are done part 1 #67

Workflow file for this run

name: CI
on: [pull_request]
jobs:
build-test:
runs-on: ubuntu-20.04
env:
KEYMANHOSTS_TIER: TIER_TEST
# Composer started complaining about running as root, but we don't care in a GHA
COMPOSER_ALLOW_SUPERUSER: 1
steps:
- name: Checkout
uses: actions/checkout@v3.5.2
# Build the docker image and create link to vendor/ dependencies
- name: Build the Docker image
shell: bash
run: |
echo "TIER_TEST" > tier.txt
./build.sh configure 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: PHP unit tests
shell: bash
run: |
docker exec web-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
run: |
set +e;
set +o pipefail;
npx broken-link-checker http://localhost:8057 --ordered --recursive --requests 50 --host-requests 50 -e --filter-level 3 | \
grep -E "BROKEN|Getting links from" | \
grep -B 1 "BROKEN"
exit ${PIPESTATUS[0]}
- 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
#
# 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 "--- tier.txt ---"
cat tier.txt
echo "--- PHP errors in Docker log ---"
docker container logs $CONTAINER 2>&1 | grep 'php7'