Skip to content

Configure tests

Configure tests #1

Workflow file for this run

name: Build
on:
push:
branches:
- master
jobs:
validate:
name: validate
runs-on: ubuntu-latest
outputs:
matrix: |
{
"dir": ${{ steps.set-matrix.outputs.dirs }}
}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate
uses: pre-commit/action@v3.0.0
- name: Configure matrix for test
id: set-matrix
run: |
DIRS=$(find . -type f -name 'docker-compose.yml' -exec dirname "{}" \; | sort -u | jq -R | jq -s -c)
echo "dirs=${DIRS}" >> "$GITHUB_OUTPUT"
test:
name: test
runs-on: ubuntu-latest
needs: validate
strategy:
matrix: ${{ fromJson(needs.validate.outputs.matrix) }}
fail-fast: false
max-parallel: 15
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Run containers
timeout-minutes: 10
working-directory: ${{ matrix.dir }}
run: |
docker compose -f up -d --wait
- name: Stop containers
if: always()
working-directory: ${{ matrix.dir }}
run: |
docker compose down -v