-
Notifications
You must be signed in to change notification settings - Fork 13
104 lines (93 loc) · 2.87 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
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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tox:
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.x"]
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh
- name: Prepare tox environment and install packages
run: |
tox --colored=yes --notest
- name: Run tests
run: |
tox --colored=yes --skip-pkg-install
example:
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
shell: bash
run: |
set -ex
sudo apt-get update
sudo apt-get install -y podman docker-compose
- name: Workaround https://github.com/actions/runner-images/issues/7753
shell: bash
run: |
curl -O http://archive.ubuntu.com/ubuntu/pool/universe/g/golang-github-containernetworking-plugins/containernetworking-plugins_1.1.1+ds1-3_amd64.deb
sudo dpkg -i containernetworking-plugins_1.1.1+ds1-3_amd64.deb
rm --force containernetworking-plugins_1.1.1+ds1-3_amd64.deb
- name: Workaround https://github.com/containers/crun/issues/1308
shell: bash
run: |
CRUN_VER='1.11.2'
sudo curl -L "https://github.com/containers/crun/releases/download/${CRUN_VER}/crun-${CRUN_VER}-linux-amd64" -o "/usr/bin/crun"
sudo chmod +x "/usr/bin/crun"
crun --version
- name: Start podman socket
shell: bash
run: |
sudo systemctl enable podman.socket
sudo systemctl restart podman.socket
- name: Build containers
working-directory: example/containers
run: |
pwd
ls -l
sudo docker-compose -H unix:///run/podman/podman.sock build --load
- name: Start containers
working-directory: example/containers
run: |
sudo docker-compose -H unix:///run/podman/podman.sock up --detach
- name: Install packages
run: |
sudo apt update
sudo apt install -y gcc python3-dev libldap2-dev libsasl2-dev sshpass
pip3 install virtualenv
python3 -m venv .venv
source .venv/bin/activate
pip3 install -e .
pip3 install -r ./requirements.txt
pip3 install -r ./example/requirements.txt
- name: Run example tests
run: |
source .venv/bin/activate
pytest --color=yes --mh-config=./example/mhc.yaml -vvv ./example