-
Notifications
You must be signed in to change notification settings - Fork 9
107 lines (100 loc) · 2.67 KB
/
it.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
103
104
105
106
107
name: Integration tests
on:
push:
branches:
- main
- staging
- trying
pull_request:
branches:
- main
jobs:
build-test-binary:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Retrieve cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-it-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: x86_64-unknown-linux-musl
- name: Build the test-binary
run: |
cp $(
cargo test \
--features docker-tests \
--test dfw \
--no-run \
--message-format=json \
--target x86_64-unknown-linux-musl \
| jq -r 'select(.profile.test == true) | .executable'
) dfw-docker-test
- name: Store the test-binary as an artifact
uses: actions/upload-artifact@v2
with:
name: dfw-docker-test
path: dfw-docker-test
test-on-docker:
needs:
- build-test-binary
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
- dind-image: docker:24.0-dind
runs-on: ubuntu-latest
- dind-image: docker:23.0-dind
runs-on: ubuntu-latest
- dind-image: docker:20.10-dind
runs-on: ubuntu-20.04
- dind-image: docker:19.03-dind
runs-on: ubuntu-20.04
- dind-image: docker:18.09-dind
runs-on: ubuntu-20.04
- dind-image: docker:18.06-dind
runs-on: ubuntu-20.04
services:
dind:
image: ${{ matrix.dind-image }}
ports:
- 2375/tcp
env:
DOCKER_TLS_CERTDIR: ""
options: --privileged
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Retrieve the test-binary
uses: actions/download-artifact@v2
with:
name: dfw-docker-test
- name: Ensure Docker is available
run: |
while ! nc -z localhost ${{ job.services.dind.ports[2375] }}; do
sleep 1
done
timeout 1m bash -c '\
until env DOCKER_HOST="tcp://127.0.0.1:${{ job.services.dind.ports[2375] }}" docker info;\
do sleep 2;\
done\
'
timeout-minutes: 1
- name: Run the test-binary
env:
RUST_TEST_THREADS: 1
DOCKER_HOST: "http://127.0.0.1:${{ job.services.dind.ports[2375] }}"
run: |
chmod +x ./dfw-docker-test
./dfw-docker-test --nocapture