mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-05-03 20:17:29 -05:00
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
name: Test scripts and build Docker images
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set TERM environment variable
|
|
run: echo "TERM=xterm" >> "$GITHUB_ENV"
|
|
|
|
# Trying to expose ports in GitHub Actions causes a "bind: address already in use" error
|
|
- name: Remove exposed ports configuration
|
|
run: yq eval "del(.services.*.ports)" -i compose.yml
|
|
|
|
- name: Run the setup script
|
|
run: ./setup.sh
|
|
|
|
# Testing whether any containers exit requires disabling restarts
|
|
- name: Remove container restart configuration
|
|
run: yq eval "del(.services.*.restart)" -i compose.yml
|
|
|
|
- name: Test starting the servers
|
|
run: |
|
|
docker compose up -d
|
|
echo Waiting for 60 seconds...
|
|
sleep 60
|
|
docker compose ps -a
|
|
docker compose logs
|
|
# Fail if any containers exited
|
|
! docker compose ps -a | grep Exited
|