Skip to content

Commit ee813b4

Browse files
committed
multi-arch-test-build: unify Dockerfile and script paths
Use a similar path structure as other workflows. Add ci_helpers through the Dockerfile. Change CI_HELPER to CI_HELPERS Remove unused volume. Signed-off-by: George Sapkin <george@sapk.in>
1 parent a2e7980 commit ee813b4

4 files changed

Lines changed: 23 additions & 17 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ARG ARCH=x86-64
2+
FROM openwrt/rootfs:$ARCH
3+
4+
ADD scripts/ci_helpers.sh /scripts/ci_helpers.sh
5+
ADD scripts/test_entrypoint.sh /scripts/test_entrypoint.sh
6+
7+
CMD ["/scripts/test_entrypoint.sh"]

.github/dockerfiles_feeds/Dockerfile

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ elif [ $PKG_MANAGER = "apk" ]; then
2222
apk update
2323
fi
2424

25-
CI_HELPER="${CI_HELPER:-/ci/.github/workflows/ci_helpers.sh}"
25+
CI_HELPERS="${CI_HELPERS:-/scripts/ci_helpers.sh}"
2626

2727
for PKG in /ci/*.[ai]pk; do
2828
if [ $PKG_MANAGER = "opkg" ]; then
@@ -62,7 +62,7 @@ for PKG in /ci/*.[ai]pk; do
6262
continue
6363
fi
6464

65-
export PKG_NAME PKG_VERSION CI_HELPER
65+
export PKG_NAME PKG_VERSION CI_HELPERS
6666

6767
if [ -f "$PRE_TEST_SCRIPT" ]; then
6868
echo "Use package specific pre-test.sh"

.github/workflows/multi-arch-test-build.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,31 +220,36 @@ jobs:
220220
sudo apt-get install -y qemu-user-static binfmt-support
221221
sudo update-binfmts --import
222222
223-
- name: Checkout
223+
- name: Checkout test scripts
224224
if: ${{ matrix.runtime_test && fromJSON(env.HAVE_PKGS) }}
225225
uses: actions/checkout@v5
226226
with:
227227
repository: openwrt/actions-shared-workflows
228-
path: dockerfiles_feeds
228+
path: workflow_context
229229
sparse-checkout: |
230230
.github/scripts/ci_helpers.sh
231-
.github/dockerfiles_feeds/Dockerfile
232-
.github/dockerfiles_feeds/entrypoint.sh
231+
.github/dockerfiles/Dockerfile.feeds
232+
.github/scripts/test_entrypoint.sh
233233
sparse-checkout-cone-mode: false
234234

235235
- name: Build Docker container
236236
if: ${{ matrix.runtime_test && fromJSON(env.HAVE_PKGS) }}
237237
run: |
238-
docker build --platform linux/${{ matrix.arch }} -t test-container \
239-
--build-arg ARCH dockerfiles_feeds/.github/dockerfiles_feeds/
238+
docker build \
239+
--build-arg ARCH \
240+
--file workflow_context/.github/dockerfiles/Dockerfile.feeds \
241+
--platform linux/${{ matrix.arch }} \
242+
--tag test-container \
243+
workflow_context/.github
240244
env:
241245
ARCH: ${{ matrix.arch }}-${{ env.BRANCH }}
242246

243247
- name: Test via Docker container
244248
if: ${{ matrix.runtime_test && fromJSON(env.HAVE_PKGS) }}
245249
run: |
246-
docker run --platform linux/${{ matrix.arch }} --rm -v $GITHUB_WORKSPACE:/ci \
247-
-v $GITHUB_WORKSPACE/dockerfiles_feeds:/dockerfiles_feeds \
248-
-e CI_HELPER=/dockerfiles_feeds/scripts/ci_helpers.sh \
250+
docker run \
249251
-e PKG_MANAGER=${{ env.PKG_MANAGER }} \
252+
--platform linux/${{ matrix.arch }} \
253+
--rm \
254+
--volume $GITHUB_WORKSPACE:/ci \
250255
test-container

0 commit comments

Comments
 (0)