diff mbox series

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

Message ID 20231122132500.117771-4-amusil@redhat.com
State Superseded
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. 22, 2023, 1:25 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>
---
 .github/workflows/test.yml | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 9fc4d3dbc..60afcba77 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -95,14 +95,24 @@  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
-        if: github.ref_name != 'ci_stabilization'
-        run: make ubuntu
+        if: github.ref_name != 'main'
+        run: make ${{ env.IMAGE_DISTRO }}
         working-directory: utilities/containers
 
       - name: Download container
-        if: github.ref_name == 'ci_stabilization'
-        run: podman pull ghcr.io/ovn-org/ovn-tests:ubuntu
+        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