diff mbox series

[ovs-dev,v3,2/3] ci: Cover more container posibilities

Message ID 20231123123807.38847-3-amusil@redhat.com
State Accepted
Headers show
Series Allow to use different container images per branch | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Ales Musil Nov. 23, 2023, 12:38 p.m. UTC
Add more conditions to the image prepare process.
This allows us to test the prebuilt images for both
Fedora and Ubuntu.

Run the weekly image on main branch with the
use of Fedora for the weekly runs.

Reported-at: https://issues.redhat.com/browse/FDP-149
Signed-off-by: Ales Musil <amusil@redhat.com>
---
v3: Add comment that explains the matrix that we have for the prepare-image job.
---
 .github/workflows/test.yml | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

Comments

Dumitru Ceara Dec. 7, 2023, 1:36 p.m. UTC | #1
On 11/23/23 13:38, Ales Musil wrote:
> Add more conditions to the image prepare process.
> This allows us to test the prebuilt images for both
> Fedora and Ubuntu.
> 
> Run the weekly image on main branch with the
> use of Fedora for the weekly runs.
> 
> Reported-at: https://issues.redhat.com/browse/FDP-149
> Signed-off-by: Ales Musil <amusil@redhat.com>
> ---
> v3: Add comment that explains the matrix that we have for the prepare-image job.
> ---

Looks good to me, thanks!

Acked-by: Dumitru Ceara <dceara@redhat.com>
diff mbox series

Patch

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index fdbc8f5f5..02865b32f 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -81,6 +81,15 @@  jobs:
       run: ./.ci/dpdk-build.sh
 
   prepare-container:
+    # This job has the following matrix, x: Job trigger, y: Branch
+    # (scheduled jobs run only on main):
+    # +-------+-------------------+-------------------+
+    # |       | Push/Pull request |     Scheduled     |
+    # +-------+-------------------+-------------------+
+    # |  main |  ghcr.io - Ubuntu | ghcr.io - Fedora  |
+    # +-------+-------------------+-------------------+
+    # | !main |  Builds - Ubuntu  | xxxxxxxxxxxxxxxxx |
+    # +-------+-------------------+-------------------+
     env:
       DEPENDENCIES: podman
     name: Prepare container
@@ -95,10 +104,25 @@  jobs:
       - name: Install dependencies
         run: sudo apt install -y ${{ env.DEPENDENCIES }}
 
+      - name: Choose image distro
+        if: github.event_name == 'push' || github.event_name == 'pull_request'
+        run: |
+          echo "IMAGE_DISTRO=ubuntu" >> $GITHUB_ENV
+
+      - name: Choose image distro
+        if: github.event_name == 'schedule'
+        run: |
+          echo "IMAGE_DISTRO=fedora" >> $GITHUB_ENV
+
       - name: Build container
-        run: make ubuntu
+        if: github.ref_name != 'main'
+        run: make ${{ env.IMAGE_DISTRO }}
         working-directory: utilities/containers
 
+      - name: Download container
+        if: github.ref_name == 'main'
+        run: podman pull ghcr.io/ovn-org/ovn-tests:${{ env.IMAGE_DISTRO }}
+
       - name: Export image
         run: podman save -o /tmp/image.tar ovn-org/ovn-tests