From db91f793dc0cb99f5cad83f5c7d64188ac6fa335 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 31 Jan 2022 16:49:01 +0100 Subject: [PATCH] port travis CI to GitHub actions Signed-off-by: Steffen Jaeckel --- .github/workflows/main.yml | 85 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 26 ------------ travis/before_script.sh | 2 +- 3 files changed, 86 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..42d42d4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,85 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + linux-tests: + runs-on: ubuntu-20.04 + + strategy: + matrix: + configure_options: + - "--without-libxml2" + - "--with-libxml2" + - "--with-gnutls" + - "--disable-tls" + - "--enable-cares" + + name: Regular Tests + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: | + sudo apt update + sudo apt install -y libtool pkg-config libexpat1-dev libxml2-dev libssl-dev libgnutls28-dev libc-ares-dev + - name: Build the library + run: | + ./bootstrap.sh + ./configure ${{ matrix.configure_options }} CFLAGS="-Werror -g3" + make -j5 + - name: Run tests + run: | + make check + + libressl-tests: + runs-on: ubuntu-20.04 + + strategy: + matrix: + libressl_versions: + - "v3.1.4" + - "v2.1.7" + + name: LibreSSL tests + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: | + sudo apt update + sudo apt install -y libtool pkg-config libexpat1-dev libxml2-dev libssl-dev libgnutls28-dev libc-ares-dev + - name: build&install libressl + env: + LIBRESSL_COMMIT: ${{ matrix.libressl_versions }} + run: | + ./travis/before_script.sh + - name: Build the library + run: | + ./bootstrap.sh + ./configure PKG_CONFIG_PATH="${HOME}/libressl/lib/pkgconfig" CFLAGS="-Werror -g3" + make -j5 + - name: Run tests + run: | + make check + + code-style: + runs-on: ubuntu-20.04 + name: Check coding style + continue-on-error: true + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: | + sudo apt update + sudo apt install -y libtool pkg-config libexpat1-dev libxml2-dev libssl-dev libgnutls28-dev libc-ares-dev dos2unix + - name: Configure + run: | + ./bootstrap.sh + ./configure + - name: Check style + run: | + make format + git diff --exit-code diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 04a7e38..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: c -dist: focal -install: - - sudo apt-get update - - sudo apt-get -y install libtool pkg-config libexpat1-dev libxml2-dev libssl-dev libgnutls28-dev libc-ares-dev dos2unix -stages: - - style - - test -env: - - CONFIGURE_OPT="--without-libxml2" - - CONFIGURE_OPT="--with-libxml2" - - CONFIGURE_OPT="--with-gnutls" - - CONFIGURE_OPT="--disable-tls" - - CONFIGURE_OPT="--enable-cares" - - CONFIGURE_OPT="PKG_CONFIG_PATH=${HOME}/libressl/lib/pkgconfig" LIBRESSL=yes LIBRESSL_COMMIT="v3.1.4" - - CONFIGURE_OPT="PKG_CONFIG_PATH=${HOME}/libressl/lib/pkgconfig" LIBRESSL=yes LIBRESSL_COMMIT="v2.1.7" -before_script: ./travis/before_script.sh -script: ./bootstrap.sh && ./configure ${CONFIGURE_OPT} CFLAGS="-Werror -g3" && make && make check -jobs: - include: - - stage: style - name: "Check coding style" - env: CONFIGURE_OPT="" - script: ./bootstrap.sh && ./configure && make format && git diff --exit-code - allow_failures: - - stage: style diff --git a/travis/before_script.sh b/travis/before_script.sh index 4b37626..c223c38 100755 --- a/travis/before_script.sh +++ b/travis/before_script.sh @@ -1,6 +1,6 @@ #!/bin/sh -if [ "x$LIBRESSL" = "xyes" ]; then +if [ "x$LIBRESSL_COMMIT" != "x" ]; then cd "$HOME" git clone https://github.com/libressl-portable/portable.git libressl-git cd libressl-git