summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2023-05-10 14:10:37 +0800
committerPaul Spooren <mail@aparcar.org>2023-05-10 11:52:51 +0200
commit5ce254fd8e4136fbb3d385f4e55e2cdae0d6eb39 (patch)
tree979f160a4d6d50a0a8992b16f1df6a57a561103d /.github/workflows
parent955a90944b2ebfbd66a6149d14126d6d9ced6c5e (diff)
CI: Do package run-tests only if target packages were built
Currently, the package run-test phase will fail for PRs that only add/update host-only packages, as no target packages (*.ipk) are built. This checks if any target packages are built before attempting the run-tests. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/multi-arch-test-build.yml17
1 files changed, 14 insertions, 3 deletions
diff --git a/.github/workflows/multi-arch-test-build.yml b/.github/workflows/multi-arch-test-build.yml
index e6295e9f8..60ff51063 100644
--- a/.github/workflows/multi-arch-test-build.yml
+++ b/.github/workflows/multi-arch-test-build.yml
@@ -160,21 +160,32 @@ jobs:
- name: Remove logs
run: sudo rm -rf logs/ || true
+ - name: Check if any packages were built
+ run: |
+ if [ -n "$(find . -maxdepth 1 -type f -name '*.ipk' -print -quit)" ]; then
+ echo "Found *.ipk files"
+ HAVE_IPKS=true
+ else
+ echo "No *.ipk files found"
+ HAVE_IPKS=false
+ fi
+ echo "HAVE_IPKS=$HAVE_IPKS" >> $GITHUB_ENV
+
- name: Register QEMU
- if: ${{ matrix.runtime_test }}
+ if: ${{ matrix.runtime_test && fromJSON(env.HAVE_IPKS) }}
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static binfmt-support
sudo update-binfmts --import
- name: Build Docker container
- if: ${{ matrix.runtime_test }}
+ if: ${{ matrix.runtime_test && fromJSON(env.HAVE_IPKS) }}
run: |
docker build -t test-container --build-arg ARCH .github/workflows/
env:
ARCH: ${{ matrix.arch }}-${{ env.BRANCH }}
- name: Test via Docker container
- if: ${{ matrix.runtime_test }}
+ if: ${{ matrix.runtime_test && fromJSON(env.HAVE_IPKS) }}
run: |
docker run --rm -v $GITHUB_WORKSPACE:/ci test-container