diff options
| author | Jeffery To <jeffery.to@gmail.com> | 2023-05-10 14:10:37 +0800 |
|---|---|---|
| committer | Nick Hainke <vincent@systemli.org> | 2023-06-26 11:48:02 +0200 |
| commit | 30b11070ade2c7d0273b50f85253c7a662da0371 (patch) | |
| tree | a1eb7ab49549d7cc97daa7b5d9f0a9e9385b59fc | |
| parent | 6ed96f5be10da3476b5641353cfb661be6061a2d (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>
(cherry picked from commit 299ee2b1cfd20a7c9d31e8024b4333e8da035af3)
| -rw-r--r-- | .github/workflows/multi-arch-test-build.yml | 17 |
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 25af766..3aabab4 100644 --- a/.github/workflows/multi-arch-test-build.yml +++ b/.github/workflows/multi-arch-test-build.yml @@ -118,21 +118,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 |
