2021-06-08 17:24:34 +02:00
|
|
|
# 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
|
|
|
|
|
2021-09-08 16:27:24 +02:00
|
|
|
ubuntu-clang-asan:
|
2021-06-08 17:24:34 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-09-08 16:27:24 +02:00
|
|
|
os: [ubuntu-20.04]
|
2021-06-08 17:24:34 +02:00
|
|
|
ssllib: [mbedtls, openssl]
|
|
|
|
|
2021-09-08 16:27:24 +02:00
|
|
|
runs-on: ${{matrix.os}}
|
2021-06-08 17:24:34 +02:00
|
|
|
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
|
2021-06-15 14:56:16 +02:00
|
|
|
|
|
|
|
msvc:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
plat: [ARM64, Win32, x64]
|
|
|
|
include:
|
|
|
|
- plat: ARM64
|
|
|
|
triplet: arm64
|
|
|
|
- plat: Win32
|
|
|
|
triplet: x86
|
|
|
|
- plat: x64
|
|
|
|
triplet: x64
|
|
|
|
|
|
|
|
env:
|
|
|
|
BUILD_CONFIGURATION: Release
|
|
|
|
VCPKG_OVERLAY_PORTS: ${{ github.workspace }}/contrib/vcpkg-ports
|
|
|
|
VCPKG_OVERLAY_TRIPLETS: ${{ github.workspace }}/contrib/vcpkg-triplets
|
|
|
|
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Add MSBuild to PATH
|
|
|
|
uses: microsoft/setup-msbuild@v1
|
|
|
|
|
2021-08-25 18:47:52 +02:00
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.x'
|
|
|
|
|
|
|
|
- name: Install rst2html
|
|
|
|
run: python -m pip install --upgrade pip rst2html
|
|
|
|
|
2021-06-15 14:56:16 +02:00
|
|
|
- name: Restore artifacts, or run vcpkg, build and cache artifacts
|
|
|
|
uses: lukka/run-vcpkg@main
|
|
|
|
with:
|
|
|
|
vcpkgArguments: 'openssl lz4 lzo pkcs11-helper tap-windows6'
|
|
|
|
vcpkgTriplet: '${{ matrix.triplet }}-windows-ovpn'
|
2021-07-27 00:39:20 +02:00
|
|
|
vcpkgGitCommitId: '261c458af6e3eed5d099144aff95d2b5035f656b'
|
2021-06-15 14:56:16 +02:00
|
|
|
cleanAfterBuild: false
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
working-directory: ${{env.GITHUB_WORKSPACE}}
|
|
|
|
run: |
|
|
|
|
vcpkg integrate install
|
|
|
|
msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform="${{ matrix.plat }}" .
|
|
|
|
|
|
|
|
- name: Archive artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: artifacts-${{ matrix.plat }}
|
|
|
|
path: |
|
|
|
|
${{ matrix.plat }}-Output/${{env.BUILD_CONFIGURATION}}/*.exe
|
|
|
|
${{ matrix.plat }}-Output/${{env.BUILD_CONFIGURATION}}/*.dll
|
2021-08-25 18:47:52 +02:00
|
|
|
${{ matrix.plat }}-Output/${{env.BUILD_CONFIGURATION}}/*.pdb
|
|
|
|
doc/openvpn.8.html
|