File tree Expand file tree Collapse file tree 5 files changed +34
-0
lines changed Expand file tree Collapse file tree 5 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,24 @@ jobs:
107
107
test -f debian/artifacts/test_1_amd64.buildinfo
108
108
test -f debian/artifacts/test_1_amd64.changes
109
109
110
+ extra-docker-args :
111
+ runs-on : ubuntu-latest
112
+ steps :
113
+ - uses : actions/checkout@v2
114
+ - run : cat test/Makefile_extra-docker-args >> test/Makefile
115
+ - uses : ./
116
+ env :
117
+ DEB_BUILD_OPTIONS : noautodbgsym
118
+ with :
119
+ buildpackage-opts : --build=binary --no-sign
120
+ source-dir : test
121
+ extra-docker-args : --add-host extra-args-test:127.0.0.1
122
+ - run : |
123
+ dpkg --info debian/artifacts/test_1_amd64.deb
124
+ dpkg --contents debian/artifacts/test_1_amd64.deb | grep ./usr/bin/mybin
125
+ test -f debian/artifacts/test_1_amd64.buildinfo
126
+ test -f debian/artifacts/test_1_amd64.changes
127
+
110
128
local-dockerfile :
111
129
runs-on : ubuntu-latest
112
130
steps :
Original file line number Diff line number Diff line change @@ -63,6 +63,13 @@ dependencies. To change this, pass `--install-recommends` in
63
63
64
64
Optional and empty by default.
65
65
66
+ # ### `extra-docker-args`
67
+ Additional command-line arguments passed to `docker run` when the build
68
+ container is started. This might be needed if specific volumes or network
69
+ settings are required.
70
+
71
+ Optional and empty by default.
72
+
66
73
# ### `host-arch`
67
74
The architecture packages are built for. If this parameter is set,
68
75
cross-compilation is set up with `apt-get` and `dpkg-buildpackage` as described
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ inputs:
19
19
extra-build-deps :
20
20
description : Extra packages to be installed as build dependencies
21
21
required : false
22
+ extra-docker-args :
23
+ description : Additional arguments to 'docker run' when starting the build container
24
+ required : false
22
25
host-arch :
23
26
description : Foreign architecture to setup cross-compilation for
24
27
required : false
38
41
INPUT_HOST_ARCH : ${{ inputs.host-arch }}
39
42
INPUT_DOCKER_IMAGE : ${{ inputs.docker-image }}
40
43
INPUT_EXTRA_BUILD_DEPS : ${{ inputs.extra-build-deps }}
44
+ INPUT_EXTRA_DOCKER_ARGS : ${{ inputs.extra-docker-args }}
41
45
INPUT_SOURCE_DIR : ${{ inputs.source-dir }}
42
46
run : ${{ github.action_path }}/scripts/run.sh
43
47
shell : bash
Original file line number Diff line number Diff line change 76
76
start_group " Starting build container"
77
77
env > " $env_file "
78
78
container_id=$( docker run \
79
+ $INPUT_EXTRA_DOCKER_ARGS \
79
80
--detach \
80
81
--env-file=" $env_file " \
81
82
--env=GITHUB_ACTION_PATH=/github/action \
Original file line number Diff line number Diff line change
1
+
2
+ .PHONY: test
3
+ test:
4
+ test "$$(awk '$$2 == "extra-args-test" { print $$1 }' /etc/hosts)" = "127.0.0.1"
You can’t perform that action at this time.
0 commit comments