From cda8065dc5d8d437892795b2ded8066ee92f55b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Thu, 3 Apr 2025 15:43:22 +0000 Subject: [PATCH] ci: add smoke testing of SDK and IB containers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently we happily accept changes, which might break SDK and/or IB containers. So lets try to minimize the regressions by adding a smoke test before pushing the container. References: #164 Link: https://github.com/openwrt/docker/pull/165 Signed-off-by: Petr Štetiar --- .github/workflows/containers.yml | 64 ++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 3 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index db411d4..2f965a3 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -194,11 +194,35 @@ jobs: ${{ matrix.target }},enable=${{ needs.generate_matrix.outputs.version == 'SNAPSHOT' }} latest,enable=${{ needs.generate_matrix.outputs.version == 'SNAPSHOT' && matrix.target == 'x86/64'}} - - name: Build and push + - name: Build + id: build + uses: docker/build-push-action@v6 + with: + no-cache: true + push: false + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + DOWNLOAD_FILE=imagebuilder-.*x86_64.tar.[xz|zst] + VERSION_PATH=${{ needs.generate_matrix.outputs.version_path }} + TARGET=${{ matrix.target }} + FILE_HOST=${{ needs.generate_matrix.outputs.file_host }} + RUN_SETUP=${{ needs.generate_matrix.outputs.run_setup }} + + - name: Smoke test + run: | + docker run ${{ steps.build.outputs.imageid }} \ + bash -c ' \ + cd $HOME && \ + bash setup.sh && \ + make image PACKAGES=coreutils-echo \ + ' + + - name: Push + if: github.event_name != 'pull_request' uses: docker/build-push-action@v6 with: no-cache: true - push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | @@ -311,7 +335,41 @@ jobs: quay.io/openwrt/sdk tags: latest - - name: Build and push + - name: Build + id: build + uses: docker/build-push-action@v6 + with: + no-cache: true + push: false + tags: | + ${{ steps.meta_ref.outputs.tags }} + ${{ steps.meta_version.outputs.tags }} + ${{ steps.meta_master.outputs.tags }} + ${{ steps.meta_target_arch.outputs.tags }} + ${{ steps.meta_latest.outputs.tags }} + build-args: | + DOWNLOAD_FILE=sdk-.*.Linux-x86_64.tar.[xz|zst] + VERSION_PATH=${{ needs.generate_matrix.outputs.version_path }} + TARGET=${{ matrix.target }} + FILE_HOST=${{ needs.generate_matrix.outputs.file_host }} + RUN_SETUP=${{ needs.generate_matrix.outputs.run_setup }} + labels: ${{ steps.meta_ref.outputs.labels }} + + - name: Smoke test + run: | + docker run --rm ${{ steps.build.outputs.imageid }} \ + bash -c ' \ + cd $HOME && \ + bash ./setup.sh && \ + make defconfig && \ + sed -i -E "s;git.openwrt.org/(feed|project|openwrt);github.com/openwrt;" feeds.conf.default && \ + ./scripts/feeds update base && \ + ./scripts/feeds install urngd && \ + make package/urngd/{clean,compile} V=s -j$(nproc) && \ + find ./bin/packages -name urngd*.?pk | grep ^./bin/packages/.*urngd \ + ' + + - name: Push uses: docker/build-push-action@v6 with: no-cache: true