[ovs-dev] [PATCH branch-2.9 1/2] github: Add GitHub Actions workflow.

Ilya Maximets i.maximets at ovn.org
Thu Nov 26 12:49:21 UTC 2020


This is an initial version of GitHub Actions support.  It mostly
mimics our current Travis CI build matrix with slight differences.

.travis folder renamed to .ci to highlight that it used not only for
Travis CI.  Travis CI support will be completely removed soon.

What happened to Travis CI:
https://mail.openvswitch.org/pipermail/ovs-dev/2020-November/377773.html

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
---
 {.travis => .ci}/linux-build.sh               |   0
 {.travis => .ci}/linux-prepare.sh             |   0
 {.travis => .ci}/osx-build.sh                 |   0
 {.travis => .ci}/osx-prepare.sh               |   0
 .github/workflows/build-and-test.yml          | 141 ++++++++++++++++++
 .travis.yml                                   |   4 +-
 .../contributing/submitting-patches.rst       |   9 +-
 Makefile.am                                   |   9 +-
 README.rst                                    |   2 +
 9 files changed, 154 insertions(+), 11 deletions(-)
 rename {.travis => .ci}/linux-build.sh (100%)
 rename {.travis => .ci}/linux-prepare.sh (100%)
 rename {.travis => .ci}/osx-build.sh (100%)
 rename {.travis => .ci}/osx-prepare.sh (100%)
 create mode 100644 .github/workflows/build-and-test.yml

diff --git a/.travis/linux-build.sh b/.ci/linux-build.sh
similarity index 100%
rename from .travis/linux-build.sh
rename to .ci/linux-build.sh
diff --git a/.travis/linux-prepare.sh b/.ci/linux-prepare.sh
similarity index 100%
rename from .travis/linux-prepare.sh
rename to .ci/linux-prepare.sh
diff --git a/.travis/osx-build.sh b/.ci/osx-build.sh
similarity index 100%
rename from .travis/osx-build.sh
rename to .ci/osx-build.sh
diff --git a/.travis/osx-prepare.sh b/.ci/osx-prepare.sh
similarity index 100%
rename from .travis/osx-prepare.sh
rename to .ci/osx-prepare.sh
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
new file mode 100644
index 000000000..edc414430
--- /dev/null
+++ b/.github/workflows/build-and-test.yml
@@ -0,0 +1,141 @@
+name: Build and Test
+
+on: [push, pull_request]
+
+jobs:
+  build-linux:
+    env:
+      dependencies: |
+        automake libtool gcc bc libjemalloc1 libjemalloc-dev    \
+        libssl-dev llvm-dev libelf-dev libnuma-dev              \
+        python-sphinx gcc-multilib
+      CC:          ${{ matrix.compiler }}
+      DPDK:        ${{ matrix.dpdk }}
+      DPDK_SHARED: ${{ matrix.dpdk_shared }}
+      KERNEL:      ${{ matrix.kernel }}
+      LIBS:        ${{ matrix.libs }}
+      BUILD_ENV:   ${{ matrix.build_env }}
+      OPTS:        ${{ matrix.opts }}
+      TESTSUITE:   ${{ matrix.testsuite }}
+
+    name: linux ${{ join(matrix.*, ' ') }}
+    runs-on: ubuntu-16.04
+    timeout-minutes: 30
+
+    strategy:
+      fail-fast: false
+      matrix:
+        compiler:    [gcc, clang]
+        kernel:      ['4.15.3', '4.14.19', '4.9.149', '4.4.115',
+                      '4.1.49', '3.10.108']
+        opts:        ['']
+        testsuite:   ['']
+        dpdk:        ['']
+        dpdk_shared: ['']
+        build_env:   ['']
+        include:
+          - compiler:     gcc
+            opts:         --disable-ssl
+          - compiler:     clang
+            opts:         --disable-ssl
+
+          - compiler:     gcc
+            testsuite:    test
+            kernel:       3.16.54
+          - compiler:     clang
+            testsuite:    test
+            kernel:       3.16.54
+
+          - compiler:     gcc
+            testsuite:    test
+            opts:         --enable-shared
+          - compiler:     clang
+            testsuite:    test
+            opts:         --enable-shared
+
+          - compiler:     gcc
+            testsuite:    test
+            libs:         -ljemalloc
+          - compiler:     clang
+            testsuite:    test
+            libs:         -ljemalloc
+
+          - compiler:     gcc
+            dpdk:         dpdk
+            kernel:       3.16.54
+          - compiler:     clang
+            dpdk:         dpdk
+            kernel:       3.16.54
+
+          - compiler:     gcc
+            dpdk:         dpdk
+            kernel:       3.16.54
+            opts:         --enable-shared
+          - compiler:     clang
+            dpdk:         dpdk
+            kernel:       3.16.54
+            opts:         --enable-shared
+
+          - compiler:     gcc
+            build_env:    -m32
+            opts:         --disable-ssl
+
+    steps:
+    - name: checkout
+      uses: actions/checkout at v2
+
+    - name: install common dependencies
+      run:  sudo apt install -y ${{ env.dependencies }}
+
+    - name: prepare
+      run:  ./.ci/linux-prepare.sh
+
+    - name: build
+      run:  PATH="$PATH:$HOME/bin" ./.ci/linux-build.sh ${{ env.OPTS }}
+
+    - name: copy logs on failure
+      if: failure() || cancelled()
+      run: |
+        # upload-artifact at v2 throws exceptions if it tries to upload socket
+        # files and we could have some socket files in testsuite.dir.
+        # Also, upload-artifact at v2 doesn't work well enough with wildcards.
+        # So, we're just archiving everything here to avoid any issues.
+        mkdir logs
+        cp config.log ./logs/
+        cp -r ./*/_build/sub/tests/testsuite.* ./logs/ || true
+        tar -czvf logs.tgz logs/
+
+    - name: upload logs on failure
+      if: failure() || cancelled()
+      uses: actions/upload-artifact at v2
+      with:
+        name: logs-linux-${{ join(matrix.*, '-') }}
+        path: logs.tgz
+
+  build-osx:
+    env:
+      CC:    clang
+      OPTS:  --disable-ssl
+
+    name:    osx clang --disable-ssl
+    runs-on: macos-latest
+    timeout-minutes: 30
+
+    strategy:
+      fail-fast: false
+
+    steps:
+    - name: checkout
+      uses: actions/checkout at v2
+    - name: install dependencies
+      run:  brew install automake libtool
+    - name: prepare
+      run:  ./.ci/osx-prepare.sh
+    - name: build
+      run:  PATH="$PATH:$HOME/bin" ./.ci/osx-build.sh
+    - name: upload logs on failure
+      if: failure()
+      uses: actions/upload-artifact at v2
+      with:
+        name: logs-osx-clang---disable-ssl
+        path: config.log
diff --git a/.travis.yml b/.travis.yml
index 89f396006..6eba3ebfc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,7 +19,7 @@ addons:
       - python-sphinx
       - libelf-dev
 
-before_install: ./.travis/${TRAVIS_OS_NAME}-prepare.sh
+before_install: ./.ci/${TRAVIS_OS_NAME}-prepare.sh
 
 before_script: export PATH=$PATH:$HOME/bin
 
@@ -44,7 +44,7 @@ matrix:
       compiler: clang
       env: OPTS="--disable-ssl"
 
-script: ./.travis/${TRAVIS_OS_NAME}-build.sh $OPTS
+script: ./.ci/${TRAVIS_OS_NAME}-build.sh $OPTS
 
 notifications:
   email:
diff --git a/Documentation/internals/contributing/submitting-patches.rst b/Documentation/internals/contributing/submitting-patches.rst
index eb7e651b8..0f57b6a9d 100644
--- a/Documentation/internals/contributing/submitting-patches.rst
+++ b/Documentation/internals/contributing/submitting-patches.rst
@@ -68,11 +68,10 @@ Testing is also important:
   feature.  A bug fix patch should preferably add a test that would
   fail if the bug recurs.
 
-If you are using GitHub, then you may utilize the travis-ci.org CI build system
-by linking your GitHub repository to it. This will run some of the above tests
-automatically when you push changes to your repository.  See the "Continuous
-Integration with Travis-CI" in :doc:`/topics/testing` for details on how to set
-it up.
+If you are using GitHub, then you may utilize the travis-ci.org and the GitHub
+Actions CI build systems.  They will run some of the above tests automatically
+when you push changes to your repository.  See the "Continuous Integration with
+Travis-CI" in :doc:`/topics/testing` for details on how to set it up.
 
 Email Subject
 -------------
diff --git a/Makefile.am b/Makefile.am
index 6d39d96cb..833640d53 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -75,11 +75,12 @@ EXTRA_DIST = \
 	MAINTAINERS.rst \
 	README.rst \
 	NOTICE \
+	.ci/linux-build.sh \
+	.ci/linux-prepare.sh \
+	.ci/osx-build.sh \
+	.ci/osx-prepare.sh \
+	.github/workflows/build-and-test.yml \
 	.travis.yml \
-	.travis/linux-build.sh \
-	.travis/linux-prepare.sh \
-	.travis/osx-build.sh \
-	.travis/osx-prepare.sh \
 	appveyor.yml \
 	boot.sh \
 	$(MAN_FRAGMENTS) \
diff --git a/README.rst b/README.rst
index d20ab2d45..9ce2646de 100644
--- a/README.rst
+++ b/README.rst
@@ -6,6 +6,8 @@
 Open vSwitch
 ============
 
+.. image:: https://github.com/openvswitch/ovs/workflows/Build%20and%20Test/badge.svg
+    :target: https://github.com/openvswitch/ovs/actions
 .. image:: https://travis-ci.org/openvswitch/ovs.png
     :target: https://travis-ci.org/openvswitch/ovs
 .. image:: https://ci.appveyor.com/api/projects/status/github/openvswitch/ovs?branch=master&svg=true&retina=true
-- 
2.25.4



More information about the dev mailing list