port travis CI to GitHub actions

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This commit is contained in:
Steffen Jaeckel
2022-01-31 16:49:01 +01:00
parent 3225bafd54
commit db91f793dc
3 changed files with 86 additions and 27 deletions

85
.github/workflows/main.yml vendored Normal file
View File

@@ -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

View File

@@ -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

View File

@@ -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