Skip to content

Commit 48b3ce0

Browse files
committed
Test; Can we run in both podman and docker?
1 parent b5674cd commit 48b3ce0

File tree

1 file changed

+61
-4
lines changed

1 file changed

+61
-4
lines changed

.github/workflows/build-test.yaml

+61-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,63 @@ on:
1010
- cron: '0 0 * * 0' # weekly
1111

1212
jobs:
13+
podman-checkout-test:
14+
runs-on: ubuntu-latest
15+
env:
16+
DOCKER_BUILDKIT: "1"
17+
AUTHNZ_EMU: "1"
18+
ANMS_COMPOSE_OPTS: "-f docker-compose.yml -p anms"
19+
AGENT_COMPOSE_OPTS: "-f agent-compose.yml -p agents"
20+
steps:
21+
- name: Versions
22+
run: |
23+
podman -v
24+
podman ps
25+
podman compose ls
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
with:
29+
submodules: recursive
30+
- name: Tag name env
31+
run: |
32+
DOCKER_IMAGE_TAG=$(echo ${{ github.head_ref || github.ref_name }} | sed 's/[^a-zA-Z0-9\-\._]/-/g')
33+
echo "DOCKER_IMAGE_TAG=${DOCKER_IMAGE_TAG}" >> $GITHUB_ENV
34+
- name: Debug GitHub workspace
35+
run: |
36+
echo "GITHUB_WORKSPACE=${{ github.workspace }}"
37+
ls -al ${{ github.workspace }}
38+
- name: Build
39+
run: |
40+
podman compose build --no-cache
41+
podman compose -f agent-compose.yml build
42+
./create_volume.sh ./puppet/modules/apl_test/files/anms/tls
43+
- name: Start
44+
run: |
45+
podman compose up -d --force-recreate
46+
podman compose -f agent-compose.yml up -d --force-recreate
47+
sleep 5
48+
- name: Status
49+
run: |
50+
for BADSTATUS in stopped restarting; do
51+
podman compose ${ANMS_COMPOSE_OPTS} ps --services --filter status=${BADSTATUS} | tee -a /tmp/notgood
52+
done
53+
# Show hints at what may be wrong
54+
for SERVNAME in $(cat /tmp/notgood); do
55+
podman compose ${ANMS_COMPOSE_OPTS} logs --tail 50 ${SERVNAME}
56+
done
57+
# Fail if any names are in the file
58+
! grep '[^[:space:]]' /tmp/notgood
59+
- name: Test
60+
run: |
61+
# Checkout the running gateway+backend
62+
podman build -t checkout-test checkout-test
63+
podman 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
64+
- name: Stop
65+
if: always()
66+
run: |
67+
for OPTS_NAME in ANMS_COMPOSE_OPTS AGENT_COMPOSE_OPTS; do
68+
podman compose ${!OPTS_NAME} rm --stop --force
69+
done
1370
checkout-test:
1471
runs-on: ubuntu-latest
1572
env:
@@ -35,10 +92,10 @@ jobs:
3592
run: |
3693
echo "GITHUB_WORKSPACE=${{ github.workspace }}"
3794
ls -al ${{ github.workspace }}
38-
- name: List Directories
39-
run: find ${{ github.workspace }} -maxdepth 2
40-
- name: Clear Cache
41-
run: rm -rf /home/runner/.cache
95+
# - name: List Directories
96+
# run: find ${{ github.workspace }} -maxdepth 2
97+
# - name: Clear Cache
98+
# run: rm -rf /home/runner/.cache
4299
- name: Build
43100
run: |
44101
docker compose build --no-cache

0 commit comments

Comments
 (0)