Skip to content

Commit 8aef2a5

Browse files
committed
multi-arch-test-build: unify Dockerfile and script paths
Use a similar path structure to 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 392498d commit 8aef2a5

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
@@ -19,7 +19,7 @@ elif [ $PKG_MANAGER = "apk" ]; then
1919
apk update
2020
fi
2121

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

2424
for PKG in /ci/*.[ai]pk; do
2525
if [ $PKG_MANAGER = "opkg" ]; then
@@ -59,7 +59,7 @@ for PKG in /ci/*.[ai]pk; do
5959
continue
6060
fi
6161

62-
export PKG_NAME PKG_VERSION CI_HELPER
62+
export PKG_NAME PKG_VERSION CI_HELPERS
6363

6464
if [ -f "$PRE_TEST_SCRIPT" ]; then
6565
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
@@ -213,31 +213,36 @@ jobs:
213213
sudo apt-get install -y qemu-user-static binfmt-support
214214
sudo update-binfmts --import
215215
216-
- name: Checkout
216+
- name: Checkout test scripts
217217
if: ${{ matrix.runtime_test && fromJSON(env.HAVE_PKGS) }}
218218
uses: actions/checkout@v6
219219
with:
220220
repository: openwrt/actions-shared-workflows
221-
path: dockerfiles_feeds
221+
path: workflow_context
222222
sparse-checkout: |
223223
.github/scripts/ci_helpers.sh
224-
.github/dockerfiles_feeds/Dockerfile
225-
.github/dockerfiles_feeds/entrypoint.sh
224+
.github/dockerfiles/Dockerfile.feeds
225+
.github/scripts/test_entrypoint.sh
226226
sparse-checkout-cone-mode: false
227227

228228
- name: Build Docker container
229229
if: ${{ matrix.runtime_test && fromJSON(env.HAVE_PKGS) }}
230230
run: |
231-
docker build --platform linux/${{ matrix.arch }} -t test-container \
232-
--build-arg ARCH dockerfiles_feeds/.github/dockerfiles_feeds/
231+
docker build \
232+
--build-arg ARCH \
233+
--file workflow_context/.github/dockerfiles/Dockerfile.feeds \
234+
--platform linux/${{ matrix.arch }} \
235+
--tag test-container \
236+
workflow_context/.github
233237
env:
234238
ARCH: ${{ matrix.arch }}-${{ env.BRANCH }}
235239

236240
- name: Test via Docker container
237241
if: ${{ matrix.runtime_test && fromJSON(env.HAVE_PKGS) }}
238242
run: |
239-
docker run --platform linux/${{ matrix.arch }} --rm -v $GITHUB_WORKSPACE:/ci \
240-
-v $GITHUB_WORKSPACE/dockerfiles_feeds:/dockerfiles_feeds \
241-
-e CI_HELPER=/dockerfiles_feeds/scripts/ci_helpers.sh \
243+
docker run \
242244
-e PKG_MANAGER=${{ env.PKG_MANAGER }} \
245+
--platform linux/${{ matrix.arch }} \
246+
--rm \
247+
--volume $GITHUB_WORKSPACE:/ci \
243248
test-container

0 commit comments

Comments
 (0)