From 96bf63197a2ca045cb0bcb251f80bf30d863bfe7 Mon Sep 17 00:00:00 2001 From: Daniele Cocca Date: Wed, 6 Dec 2023 17:39:30 +0000 Subject: [PATCH] Set up GitHub actions instead of Travis CI --- .github/workflows/build-test-cmake-linux.yml | 52 +++++++++++++ .travis.yml | 79 -------------------- README.md | 2 +- 3 files changed, 53 insertions(+), 80 deletions(-) create mode 100644 .github/workflows/build-test-cmake-linux.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build-test-cmake-linux.yml b/.github/workflows/build-test-cmake-linux.yml new file mode 100644 index 0000000..6641373 --- /dev/null +++ b/.github/workflows/build-test-cmake-linux.yml @@ -0,0 +1,52 @@ +name: Build and test with CMake on Linux + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + BUILD_TYPE: Debug + +jobs: + setup: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install prerequisites + run: | + sudo apt update -qq + sudo apt install -y libcairo2-dev libpango1.0-dev libglib2.0-dev libimlib2-dev libxinerama-dev libx11-dev libxdamage-dev libxcomposite-dev libxrender-dev libxrandr-dev libxsettings-client-dev libxsettings-dev librsvg2-dev libstartup-notification0-dev libcurl4-openssl-dev binutils xvfb xauth lcov curl pandoc + pip install --user cpp-coveralls + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCOVERALLS=ON + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + run: ctest -C ${{env.BUILD_TYPE}} + + - name: Install + run: cmake --install ${{github.workspace}}/build + + - name: Coveralls + run: | + coveralls \ + --root ${{github.workspace}}/build \ + --build-root ${{github.workspace}}/build \ + --exclude build/abseil-cpp \ + --exclude build/generated \ + --exclude build/CMakeFiles \ + --exclude abseil-cpp \ + --exclude external_includes \ + --exclude test \ + --exclude-pattern '.*_test\.cc$' \ + --exclude-lines-pattern '.*_test\.cc$' \ + --gcov-options '\-lp' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 789a40a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,79 +0,0 @@ -sudo: required -dist: bionic - -language: cpp - -compiler: - - gcc - -os: linux -addons: - apt: - packages: - # Required libraries - - libcairo2-dev - - libpango1.0-dev - - libglib2.0-dev - - libimlib2-dev - - libxinerama-dev - - libx11-dev - - libxdamage-dev - - libxcomposite-dev - - libxrender-dev - - libxrandr-dev - - libxsettings-client-dev - - libxsettings-dev - - librsvg2-dev - - libstartup-notification0-dev - - libcurl4-openssl-dev - # For more detailed AddressSanitizer reports - - binutils - # For running some tests - - xvfb - - xauth - # For Coveralls integration - - lcov - - curl - # For documentation build - - pandoc - -before_install: - # cpp-coveralls - - pip install --user cpp-coveralls - -before_script: - - mkdir "${TRAVIS_BUILD_DIR}/build" - - cd "${TRAVIS_BUILD_DIR}/build" - - cmake "${TRAVIS_BUILD_DIR}" -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=ON - -script: - # Verify tint3 builds and passes tests - - cd "${TRAVIS_BUILD_DIR}/build" - - make all test - - # Verify the installation script works, then clean up - - sudo make install DESTDIR=/opt/tint3 && sudo rm -rf /opt/tint3 - -after_success: - # Upload coverage data to Coveralls - - >- - coveralls - --root "${TRAVIS_BUILD_DIR}" - --build-root "${TRAVIS_BUILD_DIR}/build" - --exclude build/abseil-cpp - --exclude build/generated - --exclude build/CMakeFiles - --exclude abseil-cpp - --exclude external_includes - --exclude test - --exclude-pattern '.*_test\.cc$' - --exclude-lines-pattern '.*_test\.cc$' - --gcov-options '\-lp' - -notifications: - irc: - channels: - - "chat.freenode.net#tint3" - on_success: change - on_failure: always - use_notice: true diff --git a/README.md b/README.md index 707d92a..344cbe4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![build Status](https://travis-ci.org/jmc-88/tint3.svg?branch=master)](https://travis-ci.org/jmc-88/tint3) +[![Build and test with CMake on Linux](https://github.com/jmc-88/tint3/actions/workflows/build-test-cmake-linux.yml/badge.svg)](https://github.com/jmc-88/tint3/actions/workflows/build-test-cmake-linux.yml) [![CodeFactor](https://www.codefactor.io/repository/github/jmc-88/tint3/badge)](https://www.codefactor.io/repository/github/jmc-88/tint3) [![coverage status](https://coveralls.io/repos/github/jmc-88/tint3/badge.svg?branch=master)](https://coveralls.io/github/jmc-88/tint3?branch=master) [![GitHub release](https://img.shields.io/github/release/jmc-88/tint3.svg)](https://github.com/jmc-88/tint3/releases)