Skip to content

Commit

Permalink
CI: Do package run-tests only if target packages were built
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jefferyto committed May 10, 2023
1 parent fc4cac0 commit be1d23f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/multi-arch-test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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=1
else
echo "No *.ipk files found"
HAVE_IPKS=0
fi
echo "HAVE_IPKS=$HAVE_IPKS" >> $GITHUB_ENV
- name: Register QEMU
if: ${{ matrix.runtime_test }}
if: ${{ matrix.runtime_test && env.HAVE_IPKS == 1 }}
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 && env.HAVE_IPKS == 1 }}
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 && env.HAVE_IPKS == 1 }}
run: |
docker run --rm -v $GITHUB_WORKSPACE:/ci test-container
2 changes: 1 addition & 1 deletion lang/python/python-flit-core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=python-flit-core
PKG_VERSION:=3.8.0
PKG_RELEASE:=1
PKG_RELEASE:=2

PYPI_NAME:=flit-core
PYPI_SOURCE_NAME:=flit_core
Expand Down

0 comments on commit be1d23f

Please sign in to comment.