-
Notifications
You must be signed in to change notification settings - Fork 64
49 lines (41 loc) · 1.16 KB
/
ci.yml
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
name: CI
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
services:
docker:
image: docker:19.03.12
options: --privileged
ports:
- 5000:5000
- 9099:9099
- 5001:5001
- 8081:8081
- 5002:5002
- 9199:9199
- 4000:4000
- 4400:4400
- 4500:4500
- 9150:9150
- 5007:5007
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and run Docker Compose
run: docker-compose -f docker-compose.yml up --abort-on-container-exit --exit-code-from test
- name: Check Docker Compose Test Result
run: |
EXIT_CODE=$(docker inspect test --format='{{.State.ExitCode}}')
if [ "$EXIT_CODE" -ne 0 ]; then
exit $EXIT_CODE
fi