forked from yandex/mysync
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (87 loc) · 4.55 KB
/
docker-tests.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Docker tests (5.7)
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
GO_VERSION: 1.20.5
jobs:
buildimages:
name: Build images
runs-on: ubuntu-20.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Docker images caching
id: cache-images
uses: actions/cache@v3
with:
path: ~/mysync-base-img.tgz
key: mysync-base-img-${{ hashFiles('tests/images/base/*') }}
- name: Build images
if: steps.cache-images.outputs.cache-hit != 'true'
run: make base_img
- name: Export image
if: steps.cache-images.outputs.cache-hit != 'true'
run: docker save mysync-test-base | gzip -c > ~/mysync-base-img.tgz
test:
name: test
runs-on: ubuntu-20.04
needs: [ buildimages ]
strategy:
matrix:
command:
- 'GODOG_FEATURE=active_nodes.feature make test'
- 'GODOG_FEATURE=async.feature make test'
- 'GODOG_FEATURE=cascade_replicas.feature make test'
- 'GODOG_FEATURE=CLI.feature make test'
- 'GODOG_FEATURE=crash_recovery.feature make test'
- 'GODOG_FEATURE=events_reenable.feature make test'
- 'GODOG_FEATURE=failover.feature make test'
- 'GODOG_FEATURE=free_space.feature make test'
- 'GODOG_FEATURE=host_discovery.feature make test'
- 'GODOG_FEATURE=host_management.feature make test'
- 'GODOG_FEATURE=maintenance.feature make test'
- 'GODOG_FEATURE=offline_mode.feature make test'
- 'GODOG_FEATURE=priority.feature make test'
- 'GODOG_FEATURE=readonly_filesystem.feature make test'
- 'GODOG_FEATURE=recovery.feature make test'
- 'GODOG_FEATURE=repair.feature make test'
- 'GODOG_FEATURE=statefile.feature make test'
- 'GODOG_FEATURE=switchover_from.feature make test'
- 'GODOG_FEATURE=switchover_to.feature make test'
- 'GODOG_FEATURE=zk_failure.feature make test'
- 'GODOG_FEATURE=zk_maintenance.feature make test'
fail-fast: false
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Load docker images
id: cache-images
uses: actions/cache@v3
with:
path: ~/mysync-base-img.tgz
key: mysync-base-img-${{ hashFiles('tests/images/base/*') }}
- name: Fail if no cached images
if: steps.cache-images.outputs.cache-hit != 'true'
run: |
echo "Failed to fetch cached docker images. Will now exit..."
exit 1
- name: Import image
run: docker load -i ~/mysync-base-img.tgz
- name: Run test
run: ${{ matrix.command }}
- uses: actions/upload-artifact@v3
if: failure()
with:
name: logs
path: tests/logs