-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.15 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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 up -d --wait
- name: Stop containers
if: always()
working-directory: ${{ matrix.dir }}
run: |
docker compose down -v