[llvm] workflows/build-ci-container: Make sure to only test local containers (PR #120827)

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 20 23:55:29 PST 2024


https://github.com/tstellar created https://github.com/llvm/llvm-project/pull/120827

The container test is run before we create the :latest tag, so we should not try testing this, otherwise it will pull the :latest tag from the github registry, and won't test the container we just built.

>From 6a9ff4e65606d9efe7c5989c92078dca93d22577 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 20 Dec 2024 23:52:37 -0800
Subject: [PATCH] workflows/build-ci-container: Make sure to only test local
 containers

The container test is run before we create the :latest tag, so we should
not try testing this.
---
 .github/workflows/build-ci-container.yml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build-ci-container.yml b/.github/workflows/build-ci-container.yml
index 50729e0173506e..4fa0713b381ceb 100644
--- a/.github/workflows/build-ci-container.yml
+++ b/.github/workflows/build-ci-container.yml
@@ -59,8 +59,9 @@ jobs:
 
       - name: Test Container
         run: |
-          for image in ${{ steps.vars.outputs.container-name-tag }} ${{  steps.vars.outputs.container-name }}; do
-            podman run --rm -it $image /usr/bin/bash -x -c 'cd $HOME && printf '\''#include <iostream>\nint main(int argc, char **argv) { std::cout << "Hello\\n"; }'\'' | clang++ -x c++ - && ./a.out | grep Hello'
+          for image in ${{ steps.vars.outputs.container-name-tag }}; do
+            # Use --pull=never to ensure we are testing the just built image.
+            podman run --pull=never --rm -it $image /usr/bin/bash -x -c 'cd $HOME && printf '\''#include <iostream>\nint main(int argc, char **argv) { std::cout << "Hello\\n"; }'\'' | clang++ -x c++ - && ./a.out | grep Hello'
           done
 
   push-ci-container:



More information about the llvm-commits mailing list