[Openvpn-devel] Add github actions

Message ID 20210608152434.1403999-1-arne@rfc2549.org
State Accepted
Headers show
Series
  • [Openvpn-devel] Add github actions
Related show

Commit Message

Arne Schwabe June 8, 2021, 3:24 p.m.
dummy0 gives strange errors on the Ubuntu 16 runner on github actions because
dummy already exist, so use a more unique ovpn-dummy0 name instead.

Github actions are a good alternative to travis-ci, which futrure is questionable
at the moment without payment. The github actions also allows building on macOS
and Windows (not included in this commit). The  matrix is a bit different
than Coverity and uses different Ubuntu version with their native OpenSSL
(1.0.2, 1.1.1)/mbed TLS instead of manually compiling different OpenSSL
versions on just Ubuntu 20.04.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---
 .github/workflows/build.yaml               | 184 +++++++++++++++++++++
 tests/t_net.sh                             |   2 +-
 tests/unit_tests/openvpn/test_networking.c |   2 +-
 3 files changed, 186 insertions(+), 2 deletions(-)
 create mode 100644 .github/workflows/build.yaml

Comments

Lev Stipakov June 9, 2021, 6:20 a.m. | #1
Looks good, all builds passed:
https://github.com/schwabe/openvpn/actions/runs/918610289

If those two patches will be acked (none of them touches C code) and merged:

 - https://patchwork.openvpn.net/patch/1815/
 - https://patchwork.openvpn.net/patch/1850/

one could add MSVC github actions as well.

Acked-by: Lev Stipakov <lstipakov@gmail.com>
Gert Doering June 9, 2021, 6:26 a.m. | #2
Your patch has been applied to the master branch.

commit b4f658dfb018dcb22962eaa8b45ddd45c55f3003
Author: Arne Schwabe
Date:   Tue Jun 8 17:24:34 2021 +0200

     Add github actions

     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Acked-by: Lev Stipakov <lstipakov@gmail.com>
     Message-Id: <20210608152434.1403999-1-arne@rfc2549.org>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22511.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
Gert Doering June 9, 2021, 6:26 a.m. | #3
Hi,

On Tue, Jun 08, 2021 at 05:24:34PM +0200, Arne Schwabe wrote:
> +    steps:
> +      - name: Install dependencies
> +        run: sudo apt update && sudo apt install -y mingw-w64 libtool automake autoconf man2html unzip
> +      - name: Checkout ovpn-dco-win
> +        uses: actions/checkout@v2
> +        with:
> +          repository: OpenVPN/ovpn-dco-win
> +          path: ovpn-dco-win

I'm not totally happy with introducing a DCO dependency here while none
of the related code is in the tree... but since this is transient and
should not cause any issues (unless that repo disappears :-) ) it's
okayish.

gert
Arne Schwabe June 9, 2021, 10:23 a.m. | #4
Am 09.06.21 um 08:26 schrieb Gert Doering:
> Hi,
> 
> On Tue, Jun 08, 2021 at 05:24:34PM +0200, Arne Schwabe wrote:
>> +    steps:
>> +      - name: Install dependencies
>> +        run: sudo apt update && sudo apt install -y mingw-w64 libtool automake autoconf man2html unzip
>> +      - name: Checkout ovpn-dco-win
>> +        uses: actions/checkout@v2
>> +        with:
>> +          repository: OpenVPN/ovpn-dco-win
>> +          path: ovpn-dco-win
> 
> I'm not totally happy with introducing a DCO dependency here while none
> of the related code is in the tree... but since this is transient and
> should not cause any issues (unless that repo disappears :-) ) it's
> okayish.

I can send a v2 without the DCO stuff

Arne
Gert Doering June 9, 2021, 10:31 a.m. | #5
Hi,

On Wed, Jun 09, 2021 at 12:23:51PM +0200, Arne Schwabe wrote:
> I can send a v2 without the DCO stuff

It's already in :-)

(I haven't pushed it yet as I was waiting for word on the msg() patch)

gert
Илья Шипицин June 9, 2021, 10:48 a.m. | #6
вт, 8 июн. 2021 г. в 20:26, Arne Schwabe <arne@rfc2549.org>:

> dummy0 gives strange errors on the Ubuntu 16 runner on github actions
> because
> dummy already exist, so use a more unique ovpn-dummy0 name instead.
>
> Github actions are a good alternative to travis-ci, which futrure is
> questionable
> at the moment without payment. The github actions also allows building on
> macOS
>

we can remove most configurations from travis, except unique like s390x,
ppc64le, ...



> and Windows (not included in this commit). The  matrix is a bit different
> than Coverity and uses different Ubuntu version with their native OpenSSL
> (1.0.2, 1.1.1)/mbed TLS instead of manually compiling different OpenSSL
> versions on just Ubuntu 20.04.
>
> Signed-off-by: Arne Schwabe <arne@rfc2549.org>
> ---
>  .github/workflows/build.yaml               | 184 +++++++++++++++++++++
>  tests/t_net.sh                             |   2 +-
>  tests/unit_tests/openvpn/test_networking.c |   2 +-
>  3 files changed, 186 insertions(+), 2 deletions(-)
>  create mode 100644 .github/workflows/build.yaml
>
> diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
> new file mode 100644
> index 000000000..7ff379802
> --- /dev/null
> +++ b/.github/workflows/build.yaml
> @@ -0,0 +1,184 @@
> +# The name of our workflow
> +name: Build
> +on: [push, pull_request]
> +
> +jobs:
> +  mingw:
> +    strategy:
> +      matrix:
> +        include:
> +          - target: mingw64
> +            chost: x86_64-w64-mingw32
> +          - target: mingw
> +            chost: i686-w64-mingw32
> +
> +    runs-on: ubuntu-20.04
> +    env:
> +      MAKEFLAGS: -j3
> +      LZO_VERSION: "2.10"
> +      PKCS11_HELPER_VERSION: "1.26"
> +      OPENSSL_VERSION: "1.1.1j"
> +      TAP_WINDOWS_VERSION: "9.23.3"
> +      CHOST: ${{ matrix.chost }}
> +      TARGET: ${{ matrix.target }}
> +    steps:
> +      - name: Install dependencies
> +        run: sudo apt update && sudo apt install -y mingw-w64 libtool
> automake autoconf man2html unzip
> +      - name: Checkout ovpn-dco-win
> +        uses: actions/checkout@v2
> +        with:
> +          repository: OpenVPN/ovpn-dco-win
> +          path: ovpn-dco-win
> +      - name: Checkout OpenVPN
> +        uses: actions/checkout@v2
> +        with:
> +          path: openvpn
> +
> +      - name: autoconf
> +        run: autoreconf -fvi
> +        working-directory: openvpn
> +
> +      - name: Cache dependencies
> +        id: cache
> +        uses: actions/cache@v2
> +        with:
> +          path: '~/mingw/'
> +          key: ${{ matrix.target }}-mingw-${{ env.LZO_VERSION }}-${{
> env.PKCS11_HELPER_VERSION }}-${{ env.TAP_WINDOWS_VERSION }}
> +
> +      # Repeating  if: steps.cache.outputs.cache-hit != 'true'
> +      # on every step for building dependencies is ugly but
> +      # I haven't found a better solution so far.
> +
> +      - name: Download mingw depnendencies
> +        if: steps.cache.outputs.cache-hit != 'true'
> +        run: |
> +          wget -c -P download-cache/ "
> https://build.openvpn.net/downloads/releases/tap-windows-${TAP_WINDOWS_VERSION}.zip
> "
> +          wget -c -P download-cache/ "
> https://www.oberhumer.com/opensource/lzo/download/lzo-${LZO_VERSION}.tar.gz
> "
> +          wget -c -P download-cache/ "
> https://github.com/OpenSC/pkcs11-helper/archive/pkcs11-helper-${PKCS11_HELPER_VERSION}.tar.gz
> "
> +          wget -c -P download-cache/ "
> https://www.openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz
> "
> +          tar zxf
> "download-cache/pkcs11-helper-${PKCS11_HELPER_VERSION}.tar.gz"
> +          tar zxf "download-cache/openssl-${OPENSSL_VERSION}.tar.gz"
> +          tar zxf "download-cache/lzo-${LZO_VERSION}.tar.gz"
> +          unzip download-cache/tap-windows-${TAP_WINDOWS_VERSION}.zip
> +
> +      - name: Configure OpenSSL
> +        if: steps.cache.outputs.cache-hit != 'true'
> +        run: ./Configure --cross-compile-prefix=${CHOST}- shared ${{
> matrix.target }} no-capieng --prefix="${HOME}/mingw/opt"
> --openssldir="${HOME}/mingw/opt" -static-libgcc
> +        working-directory: "./openssl-1.1.1j"
> +
> +      - name: Build OpenSSL
> +        if: steps.cache.outputs.cache-hit != 'true'
> +        run: make
> +        working-directory: "./openssl-1.1.1j/"
> +
> +      - name: Install OpenSSL
> +        if: steps.cache.outputs.cache-hit != 'true'
> +        run: make install
> +        working-directory: "./openssl-1.1.1j/"
> +
> +      - name: autoreconf pkcs11-helper
> +        if: steps.cache.outputs.cache-hit != 'true'
> +        run: autoreconf -iv
> +        working-directory: "./pkcs11-helper-pkcs11-helper-1.26"
> +
> +      - name: configure pkcs11-helper
> +        if: steps.cache.outputs.cache-hit != 'true'
> +        run: OPENSSL_LIBS="-L${HOME}/mingw/opt/lib -lssl -lcrypto"
> OPENSSL_CFLAGS=-I$HOME/mingw/opt/include
> PKG_CONFIG_PATH=${HOME}/mingw/opt/lib/pkgconfig ./configure --host=${CHOST}
> --program-prefix='' --libdir=${HOME}/mingw/opt/lib
> --prefix=${HOME}/mingw/opt --build=x86_64-pc-linux-gnu
> --disable-crypto-engine-gnutls --disable-crypto-engine-nss
> --disable-crypto-engine-polarssl --disable-crypto-engine-mbedtls
> +        working-directory: "./pkcs11-helper-pkcs11-helper-1.26"
> +
> +      - name: build pkcs11-helper
> +        if: steps.cache.outputs.cache-hit != 'true'
> +        run: make all
> +        working-directory: "./pkcs11-helper-pkcs11-helper-1.26"
> +
> +      - name: install pkcs11-helper
> +        if: steps.cache.outputs.cache-hit != 'true'
> +        run: make install
> +        working-directory: "./pkcs11-helper-pkcs11-helper-1.26"
> +
> +      - name: Configure lzo
> +        if: steps.cache.outputs.cache-hit != 'true'
> +        run: ./configure --host=${CHOST} --program-prefix=''
> --libdir=${HOME}/mingw/opt/lib --prefix=${HOME}/mingw/opt
> --build=x86_64-pc-linux-gnu
> +        working-directory: "./lzo-2.10"
> +
> +      - name: build lzo
> +        if: steps.cache.outputs.cache-hit != 'true'
> +        working-directory: "./lzo-2.10"
> +        run: make
> +
> +      - name: install lzo
> +        if: steps.cache.outputs.cache-hit != 'true'
> +        working-directory: "./lzo-2.10"
> +        run: make install
> +
> +      - name: copy tap-windows.h header
> +        if: steps.cache.outputs.cache-hit != 'true'
> +        run: cp ./tap-windows-9.23.3/include/tap-windows.h
> ${HOME}/mingw/opt/include/
> +
> +      - name: configure OpenVPN
> +        run: PKG_CONFIG_PATH=${HOME}/mingw/opt/lib/pkgconfig
> DCO_SOURCEDIR=$(realpath ../ovpn-dco-win) LDFLAGS=-L$HOME/mingw/opt/lib
> CFLAGS=-I$HOME/mingw/opt/include OPENSSL_LIBS="-L${HOME}/opt/lib -lssl
> -lcrypto" OPENSSL_CFLAGS=-I$HOME/mingw/opt/include PREFIX=$HOME/mingw/opt
> LZO_CFLAGS=-I$HOME/mingw/opt/include LZO_LIBS="-L${HOME}/mingw/opt/lib
> -llzo2" ./configure  --host=${CHOST} --disable-lz4 --enable-dco
> +        working-directory: openvpn
> +
> +      - name: build OpenVPN
> +        run: make -j3
> +        working-directory: openvpn
> +
> +  ubuntu:
> +    strategy:
> +      matrix:
> +        os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]
> +        ssllib: [mbedtls, openssl]
> +
> +    runs-on: ${{matrix.os}}
> +    steps:
> +      - name: Install dependencies
> +        run: sudo apt update && sudo apt install -y liblzo2-dev
> libpam0g-dev liblz4-dev linux-libc-dev man2html libcmocka-dev
> python3-docutils libtool automake autoconf libmbedtls-dev
> +      - name: Checkout OpenVPN
> +        uses: actions/checkout@v2
> +      - name: autoconf
> +        run: autoreconf -fvi
> +      - name: configure --with-crypto-library=${{matrix.ssllib}}
> +        run: ./configure
> +      - name: make all
> +        run: make -j3
> +      - name: make check
> +        run: make check
> +
> +  ubutun20-clang-asan:
> +    strategy:
> +      matrix:
> +        os: [ubuntu-16.04, ubuntu-18.04]
> +        ssllib: [mbedtls, openssl]
> +
> +    runs-on: ubuntu-20.04
> +    steps:
> +      - name: Install dependencies
> +        run: sudo apt update && sudo apt install -y liblzo2-dev
> libpam0g-dev liblz4-dev linux-libc-dev man2html clang libcmocka-dev
> python3-docutils libtool automake autoconf libmbedtls-dev
> +      - name: Checkout OpenVPN
> +        uses: actions/checkout@v2
> +      - name: autoconf
> +        run: autoreconf -fvi
> +      - name: configure
> +        run: CFLAGS="-fsanitize=address -fno-omit-frame-pointer -O2"
> CC=clang ./configure --with-crypto-library=${{matrix.ssllib}}
> +      - name: make all
> +        run: make -j3
> +      - name: make check
> +        run: make check
> +
> +
> +  macos:
> +    runs-on: macos-latest
> +    steps:
> +      - name: Checkout OpenVPN
> +        uses: actions/checkout@v2
> +      - name: Install dependencies
> +        run: brew install openssl lzo lz4 man2html cmocka libtool
> automake autoconf
> +      - name: autoconf
> +        run: autoreconf -fvi
> +      - name: configure
> +        run: OPENSSL_CFLAGS=-I/usr/local/opt/openssl@1.1/include
> OPENSSL_LIBS="-L/usr/local/opt/openssl@1.1/lib -lcrypto -lssl" ./configure
> +      - name: make all
> +        run: make -j4
> +      - name: make check
> +        run: make check
> +
> diff --git a/tests/t_net.sh b/tests/t_net.sh
> index 246ee07bd..f9dba4040 100755
> --- a/tests/t_net.sh
> +++ b/tests/t_net.sh
> @@ -1,6 +1,6 @@
>  #!/usr/bin/env bash
>
> -IFACE="dummy0"
> +IFACE="ovpn-dummy0"
>  UNIT_TEST="./unit_tests/openvpn/networking_testdriver"
>  MAX_TEST=${1:-7}
>
> diff --git a/tests/unit_tests/openvpn/test_networking.c
> b/tests/unit_tests/openvpn/test_networking.c
> index e7c148f0e..9e9744f48 100644
> --- a/tests/unit_tests/openvpn/test_networking.c
> +++ b/tests/unit_tests/openvpn/test_networking.c
> @@ -3,7 +3,7 @@
>  #include "networking.h"
>
>
> -static char *iface = "dummy0";
> +static char *iface = "ovpn-dummy0";
>
>  static int
>  net__iface_up(bool up)
> --
> 2.32.0
>
>
>
> _______________________________________________
> Openvpn-devel mailing list
> Openvpn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openvpn-devel
>
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 8 июн. 2021 г. в 20:26, Arne Schwabe &lt;<a href="mailto:arne@rfc2549.org">arne@rfc2549.org</a>&gt;:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">dummy0 gives strange errors on the Ubuntu 16 runner on github actions because<br>
dummy already exist, so use a more unique ovpn-dummy0 name instead.<br>
<br>
Github actions are a good alternative to travis-ci, which futrure is questionable<br>
at the moment without payment. The github actions also allows building on macOS<br></blockquote><div><br></div><div>we can remove most configurations from travis, except unique like s390x, ppc64le, ...</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
and Windows (not included in this commit). The  matrix is a bit different<br>
than Coverity and uses different Ubuntu version with their native OpenSSL<br>
(1.0.2, 1.1.1)/mbed TLS instead of manually compiling different OpenSSL<br>
versions on just Ubuntu 20.04.<br>
<br>
Signed-off-by: Arne Schwabe &lt;<a href="mailto:arne@rfc2549.org" target="_blank">arne@rfc2549.org</a>&gt;<br>
---<br>
 .github/workflows/build.yaml               | 184 +++++++++++++++++++++<br>
 tests/t_net.sh                             |   2 +-<br>
 tests/unit_tests/openvpn/test_networking.c |   2 +-<br>
 3 files changed, 186 insertions(+), 2 deletions(-)<br>
 create mode 100644 .github/workflows/build.yaml<br>
<br>
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml<br>
new file mode 100644<br>
index 000000000..7ff379802<br>
--- /dev/null<br>
+++ b/.github/workflows/build.yaml<br>
@@ -0,0 +1,184 @@<br>
+# The name of our workflow<br>
+name: Build<br>
+on: [push, pull_request]<br>
+<br>
+jobs:<br>
+  mingw:<br>
+    strategy:<br>
+      matrix:<br>
+        include:<br>
+          - target: mingw64<br>
+            chost: x86_64-w64-mingw32<br>
+          - target: mingw<br>
+            chost: i686-w64-mingw32<br>
+<br>
+    runs-on: ubuntu-20.04<br>
+    env:<br>
+      MAKEFLAGS: -j3<br>
+      LZO_VERSION: &quot;2.10&quot;<br>
+      PKCS11_HELPER_VERSION: &quot;1.26&quot;<br>
+      OPENSSL_VERSION: &quot;1.1.1j&quot;<br>
+      TAP_WINDOWS_VERSION: &quot;9.23.3&quot;<br>
+      CHOST: ${{ matrix.chost }}<br>
+      TARGET: ${{ matrix.target }}<br>
+    steps:<br>
+      - name: Install dependencies<br>
+        run: sudo apt update &amp;&amp; sudo apt install -y mingw-w64 libtool automake autoconf man2html unzip<br>
+      - name: Checkout ovpn-dco-win<br>
+        uses: actions/checkout@v2<br>
+        with:<br>
+          repository: OpenVPN/ovpn-dco-win<br>
+          path: ovpn-dco-win<br>
+      - name: Checkout OpenVPN<br>
+        uses: actions/checkout@v2<br>
+        with:<br>
+          path: openvpn<br>
+          <br>
+      - name: autoconf<br>
+        run: autoreconf -fvi<br>
+        working-directory: openvpn<br>
+<br>
+      - name: Cache dependencies<br>
+        id: cache<br>
+        uses: actions/cache@v2<br>
+        with:<br>
+          path: &#39;~/mingw/&#39;<br>
+          key: ${{ matrix.target }}-mingw-${{ env.LZO_VERSION }}-${{ env.PKCS11_HELPER_VERSION }}-${{ env.TAP_WINDOWS_VERSION }}<br>
+<br>
+      # Repeating  if: steps.cache.outputs.cache-hit != &#39;true&#39;<br>
+      # on every step for building dependencies is ugly but<br>
+      # I haven&#39;t found a better solution so far.<br>
+          <br>
+      - name: Download mingw depnendencies<br>
+        if: steps.cache.outputs.cache-hit != &#39;true&#39;<br>
+        run: |<br>
+          wget -c -P download-cache/ &quot;<a href="https://build.openvpn.net/downloads/releases/tap-windows-$%7BTAP_WINDOWS_VERSION%7D.zip" rel="noreferrer" target="_blank">https://build.openvpn.net/downloads/releases/tap-windows-${TAP_WINDOWS_VERSION}.zip</a>&quot;<br>
+          wget -c -P download-cache/ &quot;<a href="https://www.oberhumer.com/opensource/lzo/download/lzo-$%7BLZO_VERSION%7D.tar.gz" rel="noreferrer" target="_blank">https://www.oberhumer.com/opensource/lzo/download/lzo-${LZO_VERSION}.tar.gz</a>&quot;<br>
+          wget -c -P download-cache/ &quot;<a href="https://github.com/OpenSC/pkcs11-helper/archive/pkcs11-helper-$%7BPKCS11_HELPER_VERSION%7D.tar.gz" rel="noreferrer" target="_blank">https://github.com/OpenSC/pkcs11-helper/archive/pkcs11-helper-${PKCS11_HELPER_VERSION}.tar.gz</a>&quot;<br>
+          wget -c -P download-cache/ &quot;<a href="https://www.openssl.org/source/old/1.1.1/openssl-$%7BOPENSSL_VERSION%7D.tar.gz" rel="noreferrer" target="_blank">https://www.openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz</a>&quot;<br>
+          tar zxf &quot;download-cache/pkcs11-helper-${PKCS11_HELPER_VERSION}.tar.gz&quot;<br>
+          tar zxf &quot;download-cache/openssl-${OPENSSL_VERSION}.tar.gz&quot;<br>
+          tar zxf &quot;download-cache/lzo-${LZO_VERSION}.tar.gz&quot;<br>
+          unzip download-cache/tap-windows-${TAP_WINDOWS_VERSION}.zip<br>
+<br>
+      - name: Configure OpenSSL<br>
+        if: steps.cache.outputs.cache-hit != &#39;true&#39;        <br>
+        run: ./Configure --cross-compile-prefix=${CHOST}- shared ${{ matrix.target }} no-capieng --prefix=&quot;${HOME}/mingw/opt&quot; --openssldir=&quot;${HOME}/mingw/opt&quot; -static-libgcc<br>
+        working-directory: &quot;./openssl-1.1.1j&quot;<br>
+        <br>
+      - name: Build OpenSSL<br>
+        if: steps.cache.outputs.cache-hit != &#39;true&#39;<br>
+        run: make<br>
+        working-directory: &quot;./openssl-1.1.1j/&quot;<br>
+<br>
+      - name: Install OpenSSL<br>
+        if: steps.cache.outputs.cache-hit != &#39;true&#39;<br>
+        run: make install<br>
+        working-directory: &quot;./openssl-1.1.1j/&quot;<br>
+        <br>
+      - name: autoreconf pkcs11-helper<br>
+        if: steps.cache.outputs.cache-hit != &#39;true&#39;<br>
+        run: autoreconf -iv<br>
+        working-directory: &quot;./pkcs11-helper-pkcs11-helper-1.26&quot;<br>
+<br>
+      - name: configure pkcs11-helper<br>
+        if: steps.cache.outputs.cache-hit != &#39;true&#39;<br>
+        run: OPENSSL_LIBS=&quot;-L${HOME}/mingw/opt/lib -lssl -lcrypto&quot; OPENSSL_CFLAGS=-I$HOME/mingw/opt/include PKG_CONFIG_PATH=${HOME}/mingw/opt/lib/pkgconfig ./configure --host=${CHOST} --program-prefix=&#39;&#39; --libdir=${HOME}/mingw/opt/lib --prefix=${HOME}/mingw/opt --build=x86_64-pc-linux-gnu --disable-crypto-engine-gnutls --disable-crypto-engine-nss --disable-crypto-engine-polarssl --disable-crypto-engine-mbedtls<br>
+        working-directory: &quot;./pkcs11-helper-pkcs11-helper-1.26&quot;<br>
+        <br>
+      - name: build pkcs11-helper<br>
+        if: steps.cache.outputs.cache-hit != &#39;true&#39;<br>
+        run: make all<br>
+        working-directory: &quot;./pkcs11-helper-pkcs11-helper-1.26&quot;<br>
+        <br>
+      - name: install pkcs11-helper<br>
+        if: steps.cache.outputs.cache-hit != &#39;true&#39;<br>
+        run: make install<br>
+        working-directory: &quot;./pkcs11-helper-pkcs11-helper-1.26&quot;<br>
+<br>
+      - name: Configure lzo<br>
+        if: steps.cache.outputs.cache-hit != &#39;true&#39;<br>
+        run: ./configure --host=${CHOST} --program-prefix=&#39;&#39; --libdir=${HOME}/mingw/opt/lib --prefix=${HOME}/mingw/opt --build=x86_64-pc-linux-gnu<br>
+        working-directory: &quot;./lzo-2.10&quot;<br>
+        <br>
+      - name: build lzo<br>
+        if: steps.cache.outputs.cache-hit != &#39;true&#39;<br>
+        working-directory: &quot;./lzo-2.10&quot;<br>
+        run: make<br>
+        <br>
+      - name: install lzo<br>
+        if: steps.cache.outputs.cache-hit != &#39;true&#39;<br>
+        working-directory: &quot;./lzo-2.10&quot;<br>
+        run: make install<br>
+<br>
+      - name: copy tap-windows.h header<br>
+        if: steps.cache.outputs.cache-hit != &#39;true&#39;<br>
+        run: cp ./tap-windows-9.23.3/include/tap-windows.h ${HOME}/mingw/opt/include/<br>
+<br>
+      - name: configure OpenVPN<br>
+        run: PKG_CONFIG_PATH=${HOME}/mingw/opt/lib/pkgconfig DCO_SOURCEDIR=$(realpath ../ovpn-dco-win) LDFLAGS=-L$HOME/mingw/opt/lib CFLAGS=-I$HOME/mingw/opt/include OPENSSL_LIBS=&quot;-L${HOME}/opt/lib -lssl -lcrypto&quot; OPENSSL_CFLAGS=-I$HOME/mingw/opt/include PREFIX=$HOME/mingw/opt LZO_CFLAGS=-I$HOME/mingw/opt/include LZO_LIBS=&quot;-L${HOME}/mingw/opt/lib -llzo2&quot; ./configure  --host=${CHOST} --disable-lz4 --enable-dco<br>
+        working-directory: openvpn<br>
+                <br>
+      - name: build OpenVPN<br>
+        run: make -j3<br>
+        working-directory: openvpn<br>
+  <br>
+  ubuntu:<br>
+    strategy:<br>
+      matrix:<br>
+        os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]<br>
+        ssllib: [mbedtls, openssl]<br>
+<br>
+    runs-on: ${{matrix.os}}<br>
+    steps:<br>
+      - name: Install dependencies<br>
+        run: sudo apt update &amp;&amp; sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev linux-libc-dev man2html libcmocka-dev python3-docutils libtool automake autoconf libmbedtls-dev<br>
+      - name: Checkout OpenVPN<br>
+        uses: actions/checkout@v2<br>
+      - name: autoconf<br>
+        run: autoreconf -fvi<br>
+      - name: configure --with-crypto-library=${{matrix.ssllib}}<br>
+        run: ./configure<br>
+      - name: make all<br>
+        run: make -j3<br>
+      - name: make check<br>
+        run: make check<br>
+          <br>
+  ubutun20-clang-asan:<br>
+    strategy:<br>
+      matrix:<br>
+        os: [ubuntu-16.04, ubuntu-18.04]<br>
+        ssllib: [mbedtls, openssl]<br>
+<br>
+    runs-on: ubuntu-20.04<br>
+    steps:<br>
+      - name: Install dependencies<br>
+        run: sudo apt update &amp;&amp; sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev linux-libc-dev man2html clang libcmocka-dev python3-docutils libtool automake autoconf libmbedtls-dev<br>
+      - name: Checkout OpenVPN<br>
+        uses: actions/checkout@v2<br>
+      - name: autoconf<br>
+        run: autoreconf -fvi<br>
+      - name: configure<br>
+        run: CFLAGS=&quot;-fsanitize=address -fno-omit-frame-pointer -O2&quot; CC=clang ./configure --with-crypto-library=${{matrix.ssllib}}<br>
+      - name: make all<br>
+        run: make -j3<br>
+      - name: make check<br>
+        run: make check<br>
+<br>
+<br>
+  macos:<br>
+    runs-on: macos-latest<br>
+    steps:<br>
+      - name: Checkout OpenVPN<br>
+        uses: actions/checkout@v2<br>
+      - name: Install dependencies<br>
+        run: brew install openssl lzo lz4 man2html cmocka libtool automake autoconf<br>
+      - name: autoconf<br>
+        run: autoreconf -fvi<br>
+      - name: configure<br>
+        run: OPENSSL_CFLAGS=-I/usr/local/opt/openssl@1.1/include  OPENSSL_LIBS=&quot;-L/usr/local/opt/openssl@1.1/lib -lcrypto -lssl&quot; ./configure<br>
+      - name: make all<br>
+        run: make -j4<br>
+      - name: make check<br>
+        run: make check<br>
+<br>
diff --git a/tests/t_net.sh b/tests/t_net.sh<br>
index 246ee07bd..f9dba4040 100755<br>
--- a/tests/t_net.sh<br>
+++ b/tests/t_net.sh<br>
@@ -1,6 +1,6 @@<br>
 #!/usr/bin/env bash<br>
<br>
-IFACE=&quot;dummy0&quot;<br>
+IFACE=&quot;ovpn-dummy0&quot;<br>
 UNIT_TEST=&quot;./unit_tests/openvpn/networking_testdriver&quot;<br>
 MAX_TEST=${1:-7}<br>
<br>
diff --git a/tests/unit_tests/openvpn/test_networking.c b/tests/unit_tests/openvpn/test_networking.c<br>
index e7c148f0e..9e9744f48 100644<br>
--- a/tests/unit_tests/openvpn/test_networking.c<br>
+++ b/tests/unit_tests/openvpn/test_networking.c<br>
@@ -3,7 +3,7 @@<br>
 #include &quot;networking.h&quot;<br>
<br>
<br>
-static char *iface = &quot;dummy0&quot;;<br>
+static char *iface = &quot;ovpn-dummy0&quot;;<br>
<br>
 static int<br>
 net__iface_up(bool up)<br>
-- <br>
2.32.0<br>
<br>
<br>
<br>
_______________________________________________<br>
Openvpn-devel mailing list<br>
<a href="mailto:Openvpn-devel@lists.sourceforge.net" target="_blank">Openvpn-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/openvpn-devel" rel="noreferrer" target="_blank">https://lists.sourceforge.net/lists/listinfo/openvpn-devel</a><br>
</blockquote></div></div>
Lev Stipakov June 15, 2021, 1:15 p.m. | #7
Hi,

This can be safely applied to release/2.5 as well (just did it on my
private repo).

I've just sent the MSVC (msbuild) follow-up:
https://patchwork.openvpn.net/patch/1861/

"Proof" that these two patches work in master:
https://github.com/lstipakov/openvpn/actions/runs/939325710 and
release: https://github.com/lstipakov/openvpn/actions/runs/939359032

ke 9. kesäk. 2021 klo 9.28 Gert Doering (gert@greenie.muc.de) kirjoitti:
>
> Your patch has been applied to the master branch.
>
> commit b4f658dfb018dcb22962eaa8b45ddd45c55f3003
> Author: Arne Schwabe
> Date:   Tue Jun 8 17:24:34 2021 +0200
>
>      Add github actions
>
>      Signed-off-by: Arne Schwabe <arne@rfc2549.org>
>      Acked-by: Lev Stipakov <lstipakov@gmail.com>
>      Message-Id: <20210608152434.1403999-1-arne@rfc2549.org>
>      URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22511.html
>      Signed-off-by: Gert Doering <gert@greenie.muc.de>
>
>
> --
> kind regards,
>
> Gert Doering
>
>
>
> _______________________________________________
> Openvpn-devel mailing list
> Openvpn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Gert Doering June 15, 2021, 1:24 p.m. | #8
Hi,

On Tue, Jun 15, 2021 at 04:15:49PM +0300, Lev Stipakov wrote:
> This can be safely applied to release/2.5 as well (just did it on my
> private repo).

OK, done as requested

commit d48ee62c40c3fdda34e8b35698c8e558d8c31ba6 (HEAD -> release/2.5)
Author: Arne Schwabe <arne@rfc2549.org>
Date:   Tue Jun 8 17:24:34 2021 +0200

    Add github actions
...
    Signed-off-by: Gert Doering <gert@greenie.muc.de>
    (cherry picked from commit b4f658dfb018dcb22962eaa8b45ddd45c55f3003)

gert

Patch

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
new file mode 100644
index 000000000..7ff379802
--- /dev/null
+++ b/.github/workflows/build.yaml
@@ -0,0 +1,184 @@ 
+# The name of our workflow
+name: Build
+on: [push, pull_request]
+
+jobs:
+  mingw:
+    strategy:
+      matrix:
+        include:
+          - target: mingw64
+            chost: x86_64-w64-mingw32
+          - target: mingw
+            chost: i686-w64-mingw32
+
+    runs-on: ubuntu-20.04
+    env:
+      MAKEFLAGS: -j3
+      LZO_VERSION: "2.10"
+      PKCS11_HELPER_VERSION: "1.26"
+      OPENSSL_VERSION: "1.1.1j"
+      TAP_WINDOWS_VERSION: "9.23.3"
+      CHOST: ${{ matrix.chost }}
+      TARGET: ${{ matrix.target }}
+    steps:
+      - name: Install dependencies
+        run: sudo apt update && sudo apt install -y mingw-w64 libtool automake autoconf man2html unzip
+      - name: Checkout ovpn-dco-win
+        uses: actions/checkout@v2
+        with:
+          repository: OpenVPN/ovpn-dco-win
+          path: ovpn-dco-win
+      - name: Checkout OpenVPN
+        uses: actions/checkout@v2
+        with:
+          path: openvpn
+          
+      - name: autoconf
+        run: autoreconf -fvi
+        working-directory: openvpn
+
+      - name: Cache dependencies
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: '~/mingw/'
+          key: ${{ matrix.target }}-mingw-${{ env.LZO_VERSION }}-${{ env.PKCS11_HELPER_VERSION }}-${{ env.TAP_WINDOWS_VERSION }}
+
+      # Repeating  if: steps.cache.outputs.cache-hit != 'true'
+      # on every step for building dependencies is ugly but
+      # I haven't found a better solution so far.
+          
+      - name: Download mingw depnendencies
+        if: steps.cache.outputs.cache-hit != 'true'
+        run: |
+          wget -c -P download-cache/ "https://build.openvpn.net/downloads/releases/tap-windows-${TAP_WINDOWS_VERSION}.zip"
+          wget -c -P download-cache/ "https://www.oberhumer.com/opensource/lzo/download/lzo-${LZO_VERSION}.tar.gz"
+          wget -c -P download-cache/ "https://github.com/OpenSC/pkcs11-helper/archive/pkcs11-helper-${PKCS11_HELPER_VERSION}.tar.gz"
+          wget -c -P download-cache/ "https://www.openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz"
+          tar zxf "download-cache/pkcs11-helper-${PKCS11_HELPER_VERSION}.tar.gz"
+          tar zxf "download-cache/openssl-${OPENSSL_VERSION}.tar.gz"
+          tar zxf "download-cache/lzo-${LZO_VERSION}.tar.gz"
+          unzip download-cache/tap-windows-${TAP_WINDOWS_VERSION}.zip
+
+      - name: Configure OpenSSL
+        if: steps.cache.outputs.cache-hit != 'true'        
+        run: ./Configure --cross-compile-prefix=${CHOST}- shared ${{ matrix.target }} no-capieng --prefix="${HOME}/mingw/opt" --openssldir="${HOME}/mingw/opt" -static-libgcc
+        working-directory: "./openssl-1.1.1j"
+        
+      - name: Build OpenSSL
+        if: steps.cache.outputs.cache-hit != 'true'
+        run: make
+        working-directory: "./openssl-1.1.1j/"
+
+      - name: Install OpenSSL
+        if: steps.cache.outputs.cache-hit != 'true'
+        run: make install
+        working-directory: "./openssl-1.1.1j/"
+        
+      - name: autoreconf pkcs11-helper
+        if: steps.cache.outputs.cache-hit != 'true'
+        run: autoreconf -iv
+        working-directory: "./pkcs11-helper-pkcs11-helper-1.26"
+
+      - name: configure pkcs11-helper
+        if: steps.cache.outputs.cache-hit != 'true'
+        run: OPENSSL_LIBS="-L${HOME}/mingw/opt/lib -lssl -lcrypto" OPENSSL_CFLAGS=-I$HOME/mingw/opt/include PKG_CONFIG_PATH=${HOME}/mingw/opt/lib/pkgconfig ./configure --host=${CHOST} --program-prefix='' --libdir=${HOME}/mingw/opt/lib --prefix=${HOME}/mingw/opt --build=x86_64-pc-linux-gnu --disable-crypto-engine-gnutls --disable-crypto-engine-nss --disable-crypto-engine-polarssl --disable-crypto-engine-mbedtls
+        working-directory: "./pkcs11-helper-pkcs11-helper-1.26"
+        
+      - name: build pkcs11-helper
+        if: steps.cache.outputs.cache-hit != 'true'
+        run: make all
+        working-directory: "./pkcs11-helper-pkcs11-helper-1.26"
+        
+      - name: install pkcs11-helper
+        if: steps.cache.outputs.cache-hit != 'true'
+        run: make install
+        working-directory: "./pkcs11-helper-pkcs11-helper-1.26"
+
+      - name: Configure lzo
+        if: steps.cache.outputs.cache-hit != 'true'
+        run: ./configure --host=${CHOST} --program-prefix='' --libdir=${HOME}/mingw/opt/lib --prefix=${HOME}/mingw/opt --build=x86_64-pc-linux-gnu
+        working-directory: "./lzo-2.10"
+        
+      - name: build lzo
+        if: steps.cache.outputs.cache-hit != 'true'
+        working-directory: "./lzo-2.10"
+        run: make
+        
+      - name: install lzo
+        if: steps.cache.outputs.cache-hit != 'true'
+        working-directory: "./lzo-2.10"
+        run: make install
+
+      - name: copy tap-windows.h header
+        if: steps.cache.outputs.cache-hit != 'true'
+        run: cp ./tap-windows-9.23.3/include/tap-windows.h ${HOME}/mingw/opt/include/
+
+      - name: configure OpenVPN
+        run: PKG_CONFIG_PATH=${HOME}/mingw/opt/lib/pkgconfig DCO_SOURCEDIR=$(realpath ../ovpn-dco-win) LDFLAGS=-L$HOME/mingw/opt/lib CFLAGS=-I$HOME/mingw/opt/include OPENSSL_LIBS="-L${HOME}/opt/lib -lssl -lcrypto" OPENSSL_CFLAGS=-I$HOME/mingw/opt/include PREFIX=$HOME/mingw/opt LZO_CFLAGS=-I$HOME/mingw/opt/include LZO_LIBS="-L${HOME}/mingw/opt/lib -llzo2" ./configure  --host=${CHOST} --disable-lz4 --enable-dco
+        working-directory: openvpn
+                
+      - name: build OpenVPN
+        run: make -j3
+        working-directory: openvpn
+  
+  ubuntu:
+    strategy:
+      matrix:
+        os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]
+        ssllib: [mbedtls, openssl]
+
+    runs-on: ${{matrix.os}}
+    steps:
+      - name: Install dependencies
+        run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev linux-libc-dev man2html libcmocka-dev python3-docutils libtool automake autoconf libmbedtls-dev
+      - name: Checkout OpenVPN
+        uses: actions/checkout@v2
+      - name: autoconf
+        run: autoreconf -fvi
+      - name: configure --with-crypto-library=${{matrix.ssllib}}
+        run: ./configure
+      - name: make all
+        run: make -j3
+      - name: make check
+        run: make check
+          
+  ubutun20-clang-asan:
+    strategy:
+      matrix:
+        os: [ubuntu-16.04, ubuntu-18.04]
+        ssllib: [mbedtls, openssl]
+
+    runs-on: ubuntu-20.04
+    steps:
+      - name: Install dependencies
+        run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev linux-libc-dev man2html clang libcmocka-dev python3-docutils libtool automake autoconf libmbedtls-dev
+      - name: Checkout OpenVPN
+        uses: actions/checkout@v2
+      - name: autoconf
+        run: autoreconf -fvi
+      - name: configure
+        run: CFLAGS="-fsanitize=address -fno-omit-frame-pointer -O2" CC=clang ./configure --with-crypto-library=${{matrix.ssllib}}
+      - name: make all
+        run: make -j3
+      - name: make check
+        run: make check
+
+
+  macos:
+    runs-on: macos-latest
+    steps:
+      - name: Checkout OpenVPN
+        uses: actions/checkout@v2
+      - name: Install dependencies
+        run: brew install openssl lzo lz4 man2html cmocka libtool automake autoconf
+      - name: autoconf
+        run: autoreconf -fvi
+      - name: configure
+        run: OPENSSL_CFLAGS=-I/usr/local/opt/openssl@1.1/include  OPENSSL_LIBS="-L/usr/local/opt/openssl@1.1/lib -lcrypto -lssl" ./configure
+      - name: make all
+        run: make -j4
+      - name: make check
+        run: make check
+
diff --git a/tests/t_net.sh b/tests/t_net.sh
index 246ee07bd..f9dba4040 100755
--- a/tests/t_net.sh
+++ b/tests/t_net.sh
@@ -1,6 +1,6 @@ 
 #!/usr/bin/env bash
 
-IFACE="dummy0"
+IFACE="ovpn-dummy0"
 UNIT_TEST="./unit_tests/openvpn/networking_testdriver"
 MAX_TEST=${1:-7}
 
diff --git a/tests/unit_tests/openvpn/test_networking.c b/tests/unit_tests/openvpn/test_networking.c
index e7c148f0e..9e9744f48 100644
--- a/tests/unit_tests/openvpn/test_networking.c
+++ b/tests/unit_tests/openvpn/test_networking.c
@@ -3,7 +3,7 @@ 
 #include "networking.h"
 
 
-static char *iface = "dummy0";
+static char *iface = "ovpn-dummy0";
 
 static int
 net__iface_up(bool up)