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

Build with ernel 3.19 dropped as it's not supported and can not be built
with gcc-7+.

Signed-off-by: Ilya Maximets <[email protected]>
---
 {.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          | 160 ++++++++++++++++++
 .travis.yml                                   |   4 +-
 .../contributing/submitting-patches.rst       |   9 +-
 Makefile.am                                   |   9 +-
 README.rst                                    |   2 +
 9 files changed, 173 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..8131a27cb
--- /dev/null
+++ b/.github/workflows/build-and-test.yml
@@ -0,0 +1,160 @@
+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 selinux-policy-dev 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.18.20', '4.17.19', '4.16.18', '4.15.18', '4.14.111',
+                      '4.9.149', '4.4.148', '3.16.57']
+        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
+            dpdk_shared:  dpdk-shared
+            kernel:       3.16.54
+          - compiler:     clang
+            dpdk_shared:  dpdk-shared
+            kernel:       3.16.54
+
+          - compiler:     gcc
+            dpdk_shared:  dpdk-shared
+            opts:         --enable-shared
+            kernel:       3.16.54
+          - compiler:     clang
+            dpdk_shared:  dpdk-shared
+            kernel:       3.16.54
+            opts:         --enable-shared
+
+          - compiler:     gcc
+            build_env:    -m32
+            opts:         --disable-ssl
+
+    steps:
+    - name: checkout
+      uses: actions/checkout@v2
+
+    - name: install common dependencies
+      run:  sudo apt install -y ${{ env.dependencies }}
+    - name: install libunbound
+      if:   matrix.build_env == ''
+      run:  sudo apt install -y libunbound-dev
+
+    - 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@v2 throws exceptions if it tries to upload socket
+        # files and we could have some socket files in testsuite.dir.
+        # Also, upload-artifact@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@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@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@v2
+      with:
+        name: logs-osx-clang---disable-ssl
+        path: config.log
diff --git a/.travis.yml b/.travis.yml
index ae60e018d..e079072ef 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,7 +22,7 @@ addons:
       - libunbound-dev
       - libunbound-dev:i386
 
-before_install: ./.travis/${TRAVIS_OS_NAME}-prepare.sh
+before_install: ./.ci/${TRAVIS_OS_NAME}-prepare.sh
 
 before_script: export PATH=$PATH:$HOME/bin
 
@@ -52,7 +52,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 5a314cc60..4a6780371 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 ff1f94b48..5abeadc58 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -76,12 +76,13 @@ EXTRA_DIST = \
        MAINTAINERS.rst \
        README.rst \
        NOTICE \
+       .ci/linux-build.sh \
+       .ci/linux-prepare.sh \
+       .ci/osx-build.sh \
+       .ci/osx-prepare.sh \
        .cirrus.yml \
+       .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 \
        poc/builders/Vagrantfile \
diff --git a/README.rst b/README.rst
index 54d06d04b..b6e81be31 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

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to