diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..036cb055 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI + +on: + push: + pull_request: + +jobs: + unix-build: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + - os: macOS-latest + openssl: openssl@1.1 + #- os: macOS-latest + # openssl: openssl@3 + + runs-on: ${{matrix.os}} + + env: + PKG_CONFIG_PATH: /usr/local/opt/${{matrix.openssl}}/lib/pkgconfig + + steps: + - uses: actions/checkout@v3 + + - name: Install apt dependencies (Linux) + if: matrix.os == 'ubuntu-latest' + run: sudo apt-get install -y libssl-dev opensc softhsm + + - name: Install brew dependencies (macOS) + if: matrix.os == 'macOS-latest' + run: brew install automake pkg-config ${{matrix.openssl}} opensc softhsm + + - name: Bootstrap + run: autoreconf --verbose --install --force + + - name: Configure + run: ./configure + + - name: Build + run: make + + - name: Test + run: make check diff --git a/.travis.sh b/.travis.sh deleted file mode 100755 index 74ff277f..00000000 --- a/.travis.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/sh -set -e -# -# Copyright (c) 2016 MichaƂ Trojnara -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -fetch_from_github() { - git clone https://github.com/$1/$2.git -b $3 --depth=1 -} - -install_from_github() { - echo "Installing $2" - fetch_from_github $1 $2 $3 - cd $2 - autoreconf -fvi - ./configure $4 $5 - make - sudo -E make install - cd .. - echo "$2 installed" - if [ $TRAVIS_OS_NAME != 'osx' ]; then - sudo ldconfig - fi -} - -install_openssl() { - echo "Installing $1" - fetch_from_github openssl openssl $1 - cd openssl - OPENSSL_DIR=/usr/local - - if [ $TRAVIS_OS_NAME == 'osx' ]; then - # To compile x86_64 version it is required to call - # './Configure darwin64-x86_64-cc' manually - ./Configure darwin64-x86_64-cc shared -fPIC \ - --openssldir=${OPENSSL_DIR} --prefix=${OPENSSL_DIR} - else - ./config shared -fPIC --openssldir=${OPENSSL_DIR} --prefix=${OPENSSL_DIR} - fi - make depend && make - sudo make install_sw - cd .. - echo "$1 installed" - if [ $TRAVIS_OS_NAME != 'osx' ]; then - sudo ldconfig - fi - SOFTHSM_OPENSSL_DIR="--with-openssl=${OPENSSL_DIR}" -} - -if [ $TRAVIS_OS_NAME = 'osx' ]; then - export HOMEBREW_NO_AUTO_UPDATE=1 - export HOMEBREW_NO_INSTALL_CLEANUP=1 - brew install pcsc-lite - brew link --force pcsc-lite -else - sudo apt-get update -qq - - # libpcsclite-dev is required for OpenSC - sudo apt-get install -y libpcsclite-dev -fi - -export CC=`which $CC` -mkdir prerequisites -cd prerequisites - -if [ -n "${OPENSSL}" ]; then - - if [ $TRAVIS_OS_NAME != 'osx' ]; then - # Remove pre-installed OpenSSL - sudo apt-get remove openssl libssl-dev - fi - - install_openssl ${OPENSSL} -fi - -# sometimes git master has compile warnings in it -install_from_github OpenSC OpenSC master --disable-strict - -# softhsm is required for "make check" -install_from_github opendnssec SoftHSMv2 master --disable-gost \ - ${SOFTHSM_OPENSSL_DIR} - -cd .. -rm -rf prerequisites diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 63b5dce6..00000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -language: c -sudo: required - -env: - global: - # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created - # via the "travis encrypt" command using the project repo's public key - - secure: "o1Gatu7TwkfWYzmUht2+N5S7dhxUjcajFBT3cRoj3xXH0ghCZ2Yyu+yRDakYujIXb1waUMiwNdPQOxjEbo/2oLRoV3E29wi6bZWhO7RBymM6zHTEoGY7F2XXYOxWlVeU2x4TrYS7UWgosCK1Hi3A0nOnvbMQFfV8F5R0RouKJvM=" - - COVERITY_SCAN_BRANCH_PATTERN="(master|coverity.*)" - - COVERITY_SCAN_NOTIFICATION_EMAIL="Michal.Trojnara@stunnel.org" - - COVERITY_SCAN_BUILD_COMMAND="make" - - COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG" - - SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) - matrix: - - OPENSSL="OpenSSL_1_0_2-stable" - - OPENSSL="OpenSSL_1_1_0-stable" - - OPENSSL="OpenSSL_1_1_1-stable" - -compiler: - - gcc - - clang - -os: - - linux - - osx - -matrix: - include: - - os: linux - compiler: gcc - env: DO_COVERITY_SCAN=yes - -install: - - ./.travis.sh - -before_script: - - touch config.rpath && autoreconf -fvi && ./configure ${CONFIG_FLAGS} - # Optionally try to upload to Coverity Scan - # On error (propably quota is exhausted), just continue - - echo -n | openssl s_client -connect https://scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- - - if [ -n "${DO_COVERITY_SCAN}" ]; then curl -s 'https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh' | bash || true; fi - - openssl version -a - -script: - - if [ -z "${DO_COVERITY_SCAN}" ]; then - make && make check && make dist; - fi - -after_failure: - - cat tests/test-suite.log diff --git a/README.md b/README.md index dda84bf8..f39537e2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Build state -[![Linux Build Status](https://travis-ci.org/OpenSC/libp11.png)](https://travis-ci.org/OpenSC/libp11) +[![Tests](https://github.com/OpenSC/libp11/actions/workflows/ci.yml/badge.svg)](https://github.com/OpenSC/libp11/actions/workflows/ci.yml) [![Windows Build status](https://ci.appveyor.com/api/projects/status/kmbu8nex5ogecoiq?svg=true)](https://ci.appveyor.com/project/LudovicRousseau/libp11) [![Coverity Scan Status](https://scan.coverity.com/projects/15472/badge.svg)](https://scan.coverity.com/projects/opensc-libp11) [![Code Quality: Cpp](https://img.shields.io/lgtm/grade/cpp/g/OpenSC/libp11.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/OpenSC/libp11/context:cpp)