File tree 10 files changed +87
-97
lines changed
10 files changed +87
-97
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+ on : push
3
+ jobs :
4
+ build-and-test :
5
+ runs-on : ubuntu-20.04
6
+ strategy :
7
+ fail-fast : false
8
+ matrix :
9
+ include :
10
+ - arch : amd64
11
+ docker_image : debian:buster
12
+
13
+ - arch : arm64
14
+ docker_image : arm64v8/debian:buster
15
+
16
+ - arch : ppc64le
17
+ docker_image : ppc64le/debian:buster
18
+
19
+ - arch : s390x
20
+ docker_image : s390x/debian:buster
21
+
22
+ env :
23
+ BASE_IMAGE : ${{ matrix.docker_image }}
24
+
25
+ steps :
26
+ - uses : actions/checkout@v2
27
+
28
+ - name : Set up QEMU
29
+ id : qemu
30
+ uses : docker/setup-qemu-action@v1
31
+ if : ${{ matrix.arch != 'amd64' }}
32
+ with :
33
+ image : tonistiigi/binfmt:latest
34
+
35
+ - name : Build Docker image
36
+ run : make docker-image
37
+
38
+ - name : Run python tests
39
+ run : docker run --rm -v $(pwd):/mnt:rw dumb-init-build /mnt/ci/docker-python-test
40
+
41
+ - name : Build Debian package
42
+ run : docker run --init --rm -v $(pwd):/mnt:rw dumb-init-build make -C /mnt builddeb
43
+
44
+ - name : Test built Debian package
45
+ # XXX: This uses the clean base image (not the build one) to make
46
+ # sure it installs in a clean image without any hidden dependencies.
47
+ run : docker run --rm -v $(pwd):/mnt:rw ${{ matrix.docker_image }} /mnt/ci/docker-deb-test
48
+
49
+ - name : Upload build artifacts
50
+ uses : actions/upload-artifact@v2
51
+ with :
52
+ name : ${{ matrix.arch }}
53
+ path : dist
54
+
55
+ # TODO: switch to pre-commit.ci
56
+ pre-commit :
57
+ runs-on : ubuntu-20.04
58
+ steps :
59
+ - uses : actions/checkout@v2
60
+
61
+ - name : Set up Python
62
+ uses : actions/setup-python@v2
63
+ with :
64
+ python-version : ' 3.8'
65
+
66
+ - name : Install tox
67
+ run : pip install tox
68
+
69
+ - name : Run pre-commit
70
+ run : tox -e pre-commit
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- FROM debian:buster
1
+ ARG BASE_IMAGE=debian:buster
2
+ FROM $BASE_IMAGE
2
3
3
4
LABEL maintainer=
"Chris Kuehl <[email protected] >"
4
5
5
- # The default mirrors are too flaky to run reliably in CI.
6
- RUN sed -E \
7
- '/security\. debian/! s@http://[^/]+/@http://mirrors.kernel.org/@' \
8
- -i /etc/apt/sources.list
9
-
10
6
# Install the bare minimum dependencies necessary for working with Debian
11
7
# packages. Build dependencies should be added under "Build-Depends" inside
12
8
# debian/control instead.
@@ -17,6 +13,9 @@ RUN : \
17
13
devscripts \
18
14
equivs \
19
15
lintian \
16
+ python3-distutils \
17
+ python3-setuptools \
18
+ python3-pip \
20
19
&& apt-get clean \
21
20
&& rm -rf /var/lib/apt/lists/*
22
21
WORKDIR /tmp/mnt
@@ -27,5 +26,3 @@ RUN : \
27
26
&& mk-build-deps --install --tool 'apt-get -y --no-install-recommends' /control \
28
27
&& apt-get clean \
29
28
&& rm -rf /var/lib/apt/lists/*
30
-
31
- ENTRYPOINT make builddeb
Original file line number Diff line number Diff line change @@ -54,11 +54,11 @@ builddeb:
54
54
.PHONY : builddeb-docker
55
55
builddeb-docker : docker-image
56
56
mkdir -p dist
57
- docker run --user $$(id -u ) :$$(id -g ) -v $(PWD ) :/tmp/mnt dumb-init-build
57
+ docker run --init -- user $$(id -u ) :$$(id -g ) -v $(PWD ) :/tmp/mnt dumb-init-build make builddeb
58
58
59
59
.PHONY : docker-image
60
60
docker-image :
61
- docker build -t dumb-init-build .
61
+ docker build $( if $( BASE_IMAGE ) ,--build-arg BASE_IMAGE= $( BASE_IMAGE ) ) -t dumb-init-build .
62
62
63
63
.PHONY : test
64
64
test :
68
68
.PHONY : install-hooks
69
69
install-hooks :
70
70
tox -e pre-commit -- install -f --install-hooks
71
-
72
- ITEST_TARGETS = itest_focal itest_buster
73
-
74
- .PHONY : itest $(ITEST_TARGETS )
75
- itest : $(ITEST_TARGETS )
76
-
77
- itest_focal : _itest-ubuntu-focal
78
- itest_buster : _itest-debian-buster
79
-
80
- itest_tox :
81
- $(DOCKER_RUN_TEST ) debian:buster /mnt/ci/docker-tox-test
82
-
83
- _itest-% : _itest_deb-% _itest_python-%
84
- @true
85
-
86
- _itest_python-% :
87
- $(DOCKER_RUN_TEST ) $(shell sed 's/-/:/' <<< "$* ") /mnt/ci/docker-python-test
88
-
89
- _itest_deb-% : builddeb-docker
90
- $(DOCKER_RUN_TEST ) $(shell sed 's/-/:/' <<< "$* ") /mnt/ci/docker-deb-test
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#! /bin/bash -eux
2
2
set -o pipefail
3
3
4
- . /mnt/ci/docker
4
+ apt-get update
5
+ apt-get -y --no-install-recommends install python3-pip procps
5
6
7
+ cd /mnt
6
8
dpkg -i dist/* .deb
7
9
pip3 install -r requirements-dev.txt
8
10
pytest tests/
Original file line number Diff line number Diff line change 1
1
#! /bin/bash -eux
2
- set -o pipefail
2
+ set -euo pipefail
3
3
4
- . /mnt/ci/docker
4
+ cd /mnt
5
5
6
6
python3 setup.py clean
7
7
python3 setup.py sdist
8
8
pip3 install -vv dist/* .tar.gz
9
9
pip3 install -r requirements-dev.txt
10
- pytest tests/
10
+ pytest-3 -vv tests/
11
11
12
12
exec dumb-init /mnt/tests/test-zombies
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
[pytest]
2
- timeout = 5
2
+ timeout = 20
Original file line number Diff line number Diff line change 1
1
[tox]
2
- envlist = py37 ,gcov
2
+ envlist = py38 ,gcov
3
3
4
4
[testenv]
5
5
deps = -r{toxinidir}/requirements-dev.txt
@@ -8,14 +8,14 @@ commands =
8
8
9
9
[testenv:gcov]
10
10
skip_install = True
11
- basepython = /usr/bin/python3.7
11
+ basepython = /usr/bin/python3.8
12
12
commands =
13
13
{toxinidir}/ci/gcov-build {envbindir}
14
14
{[testenv]commands}
15
15
{toxinidir}/ci/gcov-report
16
16
17
17
[testenv:pre-commit]
18
- basepython = /usr/bin/python3.7
18
+ basepython = /usr/bin/python3.8
19
19
commands = pre-commit {posargs:run --all-files}
20
20
21
21
[flake8]
You can’t perform that action at this time.
0 commit comments