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

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 20 23:56:08 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-github-workflow

Author: Tom Stellard (tstellar)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/120827.diff


1 Files Affected:

- (modified) .github/workflows/build-ci-container.yml (+3-2) 


``````````diff
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:

``````````

</details>


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


More information about the llvm-commits mailing list