Testing that RPMs can be built to catch possible spec file
issues like missing dependencies.

GitHub seems to have an agreement with Docker Hub about rate
limiting of image downloads, so it should not affect us.
We may switch to quay.io if that will ever become a problem
in the future.

Signed-off-by: Ilya Maximets <i.maxim...@ovn.org>
---

Version 2:
  * Changed the task name from build-rpm-fedora to build-linux-rpm. [David]
  * Switched to ubuntu-latest.  [David]

 .github/workflows/build-and-test.yml | 37 ++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/.github/workflows/build-and-test.yml 
b/.github/workflows/build-and-test.yml
index 82675b973..39649c1b5 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -242,3 +242,40 @@ jobs:
       with:
         name: deb-packages-${{ matrix.dpdk }}-dpdk
         path: '/home/runner/work/ovs/*.deb'
+
+  build-linux-rpm:
+    name: linux rpm fedora
+    runs-on: ubuntu-latest
+    container: fedora:37
+    timeout-minutes: 30
+
+    strategy:
+      fail-fast: false
+
+    steps:
+    - name: checkout
+      uses: actions/checkout@v3
+    - name: install dependencies
+      run: |
+        dnf install -y rpm-build dnf-plugins-core
+        sed -e 's/@VERSION@/0.0.1/' rhel/openvswitch-fedora.spec.in \
+            > /tmp/ovs.spec
+        dnf builddep -y /tmp/ovs.spec
+        rm -f /tmp/ovs.spec
+
+    - name: configure
+      run:  ./boot.sh && ./configure
+
+    - name: build
+      run:  make rpm-fedora
+
+    - name: install
+      run:  dnf install -y rpm/rpmbuild/RPMS/*/*.rpm
+
+    - name: upload rpm packages
+      uses: actions/upload-artifact@v3
+      with:
+        name: rpm-packages
+        path: |
+          rpm/rpmbuild/SRPMS/*.rpm
+          rpm/rpmbuild/RPMS/*/*.rpm
-- 
2.39.2

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to