Run integration checkout test #121
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run integration checkout test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: {} # any target | |
schedule: | |
- cron: '0 0 * * 0' # weekly | |
jobs: | |
checkout-test: | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_BUILDKIT: "1" | |
AUTHNZ_EMU: "1" | |
ANMS_COMPOSE_OPTS: "-f docker-compose.yml -p anms" | |
AGENT_COMPOSE_OPTS: "-f agent-compose.yml -p agents" | |
steps: | |
- name: Versions | |
run: | | |
docker -v | |
docker ps | |
docker compose ls | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Tag name env | |
run: | | |
DOCKER_IMAGE_TAG=$(echo ${{ github.head_ref || github.ref_name }} | sed 's/[^a-zA-Z0-9\-\._]/-/g') | |
echo "DOCKER_IMAGE_TAG=${DOCKER_IMAGE_TAG}" >> $GITHUB_ENV | |
- name: Build | |
run: | | |
./build.sh buildonly | |
./create_volume.sh ./puppet/modules/apl_test/files/anms/tls | |
- name: Start | |
run: | | |
for OPTS_NAME in ANMS_COMPOSE_OPTS AGENT_COMPOSE_OPTS; do | |
docker compose ${!OPTS_NAME} up --detach --force-recreate | |
done | |
sleep 5 | |
- name: Status | |
run: | | |
for BADSTATUS in stopped restarting; do | |
docker compose ${ANMS_COMPOSE_OPTS} ps --services --filter status=${BADSTATUS} | tee -a /tmp/notgood | |
done | |
# Show hints at what may be wrong | |
for SERVNAME in $(cat /tmp/notgood); do | |
docker compose ${ANMS_COMPOSE_OPTS} logs --tail 50 ${SERVNAME} | |
done | |
# Fail if any names are in the file | |
! grep '[^[:space:]]' /tmp/notgood | |
- name: Test | |
run: | | |
# Checkout the running gateway+backend | |
docker build -t checkout-test checkout-test | |
docker run --network anms -v $PWD:/mnt -e XUNIT_OUTFILE=/mnt/testresults.xml -e CHECKOUT_BASE_URL=http://authnz/ -e SSL_CERT_FILE=/mnt/puppet/modules/apl_test/files/anms/tls/certs/ammos-ca-bundle.crt checkout-test | |
- name: Stop | |
if: always() | |
run: | | |
for OPTS_NAME in ANMS_COMPOSE_OPTS AGENT_COMPOSE_OPTS; do | |
docker compose ${!OPTS_NAME} rm --stop --force | |
done |