-
Notifications
You must be signed in to change notification settings - Fork 107
136 lines (127 loc) · 3.78 KB
/
python-package.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Run tests
on:
push:
branches:
- master
pull_request: {}
jobs:
build-linux-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Run all tests
run: |
cat /etc/docker/daemon.json
echo '{"insecure-registries" : [ "localhost:5000" ]}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
sleep 2
docker info
pip install -e .
pip install -r ./lint-requirements.txt
flake8
isort --check ./
black --check ./
build-linux-test-with-binaries-other-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Run all tests
run: |
bash tests/ci-setup.sh
python -m pytest -v --durations=10 --ignore=tests/python_on_whales/components
build-linux-test-component:
strategy:
matrix:
component:
- buildx
- test_compose.py
- test_config.py
- test_container.py
- test_context.py
- test_image.py
- test_manifest.py
- test_network.py
- test_node.py
- test_plugin.py
- test_service.py
- test_stack.py
- test_swarm.py
- test_system.py
- test_task.py
- test_volume.py
pydantic-version:
- pydantic==1.*
- pydantic==2.*
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Run test
run: |
bash tests/ci-setup.sh
pip install --upgrade ${{ matrix.pydantic-version }}
python -m pytest -v --durations=10 tests/python_on_whales/components/${{ matrix.component }}
build-linux-test-without-any-binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Run all tests
run: |
cat /etc/docker/daemon.json
echo '{"insecure-registries" : [ "localhost:5000" ]}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
sleep 2
docker info
python -m pip install -e .
python -m pip install -r ./tests/test-requirements.txt
python -m pytest -v --durations=10 ./tests/python_on_whales/components/buildx
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: prepare
run: |
python -m pip install -r tests/test-requirements.txt
python -m pip install -e .
- name: Run all tests
run: |
docker run hello-world
python -m pytest -v ./tests/python_on_whales/components/test_volume.py::test_simple_volume
# cost too much at the moment.
# build-macos:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v2
# - name: Install docker
# run: |
# mkdir -p ~/.docker/machine/cache
# curl -Lo ~/.docker/machine/cache/boot2docker.iso https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso
# brew install docker docker-machine
# docker-machine create --driver virtualbox default
# docker-machine env default
# - uses: actions/setup-python@v2
# with:
# python-version: 3.8
# - name: prepare
# run: |
# pip install -r tests/test-requirements.txt
# pip install -e .
# - name: Run all tests
# run: |
# eval "$(docker-machine env default)"
# docker run hello-world
# pytest -v ./tests