From b3e640a8ef52967478b942459edfda4b85c5b344 Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Tue, 31 Mar 2020 14:31:24 +0200 Subject: [PATCH 1/4] Remove CircleCI and Travis CI Those will get replaced by Github Actions --- .circleci/config.yml | 71 -------------------------------------------- .travis.yml | 38 ------------------------ README.md | 2 +- 3 files changed, 1 insertion(+), 110 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .travis.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 42eb03e..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,71 +0,0 @@ -version: 2.1 -jobs: - misc-doxygen: - docker: - - image: dunst/ci:misc-doxygen - environment: - SYSTEMD: 0 - SERVICEDIR_DBUS: /tmp/none - SERVICEDIR_SYSTEMD: /tmp/none - PKG_CONFIG: echo - steps: - - checkout - - run: make -j doc-doxygen - - compileandtest: - environment: - CFLAGS: -Werror - parameters: - distro: - type: string - docker: - - image: dunst/ci:<> - steps: - - checkout - - run: make CC=clang -j all dunstify test/test - - run: make CC=clang -j test-valgrind - - run: ./test/test-install.sh - - run: make clean - - run: make CC=gcc -j all dunstify test/test - - run: make CC=gcc -j test-valgrind - - run: make clean - - run: make -j test-coverage - -workflows: - version: 2 - build-in-docker: - jobs: - - misc-doxygen - - compileandtest: - name: Alpine - distro: alpine - - compileandtest: - name: Debian Stretch - distro: debian-stretch - requires: - - misc-doxygen - - Alpine - - compileandtest: - name: Arch Linux - distro: archlinux - requires: - - misc-doxygen - - Alpine - - compileandtest: - name: Fedora 30 - distro: fedora30 - requires: - - misc-doxygen - - Alpine - - compileandtest: - name: Ubuntu 16.04 - distro: ubuntu-xenial - requires: - - misc-doxygen - - Alpine - - compileandtest: - name: Ubuntu 18.04 - distro: ubuntu-bionic - requires: - - misc-doxygen - - Alpine diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 11c24db..0000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ -addons: - apt: - packages: - - doxygen - - graphviz - - libdbus-1-dev - - libx11-dev - - libxrandr-dev - - libxinerama-dev - - libxss-dev - - libglib2.0-dev - - libpango1.0-dev - - libcairo2-dev - - libnotify-dev - - libgtk-3-dev - - valgrind -dist: xenial -sudo: false -language: c - -git: - depth: false - -before_install: - - pip install --user cpp-coveralls - -script: - - CFLAGS="-Werror" make all dunstify test-valgrind doc-doxygen - - ./test/test-install.sh - - CFLAGS="-Werror" make clean - - CFLAGS="-Werror" make test-coverage - -matrix: - include: - - compiler: gcc - after_success: - - coveralls - - compiler: clang diff --git a/README.md b/README.md index 9102d5b..d9fd346 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![CircleCI](https://circleci.com/gh/dunst-project/dunst/tree/master.svg?style=svg)](https://circleci.com/gh/dunst-project/dunst/tree/master) [![Build Status](https://travis-ci.org/dunst-project/dunst.svg?branch=master)](https://travis-ci.org/dunst-project/dunst) [![Coverage Status](https://coveralls.io/repos/github/dunst-project/dunst/badge.svg?branch=master)](https://coveralls.io/github/dunst-project/dunst?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/dunst-project/dunst/badge.svg?branch=master)](https://coveralls.io/github/dunst-project/dunst?branch=master) ## Dunst From 29e02c2a2927f24c93fb14d85fb87e0243b591fd Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Tue, 31 Mar 2020 15:30:09 +0200 Subject: [PATCH 2/4] Introduce Github Actions as CI --- .github/workflows/main.yml | 69 ++++++++++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..7cb072a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,69 @@ +name: main + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + strategy: + matrix: + CC: + - clang + - gcc + distro: + - alpine + - archlinux + - debian-stretch + - fedora + - ubuntu-xenial + - ubuntu-bionic + + env: + CC: ${{ matrix.CC }} + steps: + - uses: actions/checkout@v2 + with: + # Clone the whole branch, we have to fetch tags later + fetch-depth: 0 + + # Fetch tags to determine proper version number inside git + - name: fetch tags + run: git fetch --tags + # We cannot pull tags with old distros, since there is no `.git`. See below. + if: "! (matrix.distro == 'ubuntu-bionic' || matrix.distro == 'ubuntu-xenial' || matrix.distro == 'debian-stretch')" + + # The Github checkout Action doesn't support distros with git older than 2.18 + # With git<2.18 it downloads the code via API and does not clone it via git :facepalm: + # To succeed the tests, we have to manually replace the VERSION macro + - name: fix version number for old distros + run: 'sed -i "s/1.4.1-non-git/1.4.1-ci-oldgit-$GITHUB_SHA/" Makefile' + if: " (matrix.distro == 'ubuntu-bionic' || matrix.distro == 'ubuntu-xenial' || matrix.distro == 'debian-stretch')" + + - name: build + run: make -j all dunstify test/test + + - name: test + run: make -j test + + - name: installation + run: ./test/test-install.sh + + - name: valgrind memleaks + run: | + make clean + make -j test-valgrind + + - name: coverage + run: | + make clean + make -j test-coverage + + + runs-on: ubuntu-latest + container: + image: dunst/ci:${{ matrix.distro }} diff --git a/README.md b/README.md index d9fd346..b2dc05e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Coverage Status](https://coveralls.io/repos/github/dunst-project/dunst/badge.svg?branch=master)](https://coveralls.io/github/dunst-project/dunst?branch=master) +[![main](https://github.com/dunst-project/dunst/workflows/main/badge.svg)](https://github.com/dunst-project/dunst/actions?query=workflow%3Amain) [![Coverage Status](https://coveralls.io/repos/github/dunst-project/dunst/badge.svg?branch=master)](https://coveralls.io/github/dunst-project/dunst?branch=master) ## Dunst From db76fff1ca1b9b9125c48df31f2f3413d12a467e Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Tue, 31 Mar 2020 17:54:13 +0200 Subject: [PATCH 3/4] Add coveralls settings --- .github/workflows/main.yml | 23 +++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 24 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7cb072a..cb2d39b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,7 +63,30 @@ jobs: make clean make -j test-coverage + - name: Coveralls assemble with lcov + run: lcov -c -d . -o lcov.info + if: "matrix.CC == 'gcc'" + + - name: Coveralls upload + uses: coverallsapp/github-action@master + if: "matrix.CC == 'gcc'" + with: + parallel: true + path-to-lcov: "./lcov.info" + github-token: ${{ secrets.GITHUB_TOKEN }} runs-on: ubuntu-latest container: image: dunst/ci:${{ matrix.distro }} + +# Just send the signal to coveralls to finish +# the build and finalise coverage stats + finish-coverage: + needs: build + runs-on: ubuntu-latest + steps: + - name: Coveralls finish + uses: coverallsapp/github-action@master + with: + parallel-finish: true + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index dc85941..4309990 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.gcda *.gcno *.gcov +/lcov.info core vgcore.* From c4fe74df37037bcf23d1044badb1dc4791d0ee4c Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Tue, 31 Mar 2020 23:37:12 +0200 Subject: [PATCH 4/4] Use Codecov, coveralls doesn't work at all The docs of the Github action aren't working at all and are not deemed to work. The "parallels" feature is completely broken and others have solved it by switching to Codecov. See coverallsapp/github-action#13 --- .github/workflows/main.yml | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cb2d39b..b4f5493 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,30 +63,19 @@ jobs: make clean make -j test-coverage - - name: Coveralls assemble with lcov + - name: Generate coverage report run: lcov -c -d . -o lcov.info if: "matrix.CC == 'gcc'" - - name: Coveralls upload - uses: coverallsapp/github-action@master - if: "matrix.CC == 'gcc'" + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 with: - parallel: true - path-to-lcov: "./lcov.info" - github-token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.CODECOV_TOKEN }} + flags: unittests + name: ${{ matrix.distro }}-${{ matrix.CC }} + fail_ci_if_error: true + if: "matrix.CC == 'gcc'" runs-on: ubuntu-latest container: image: dunst/ci:${{ matrix.distro }} - -# Just send the signal to coveralls to finish -# the build and finalise coverage stats - finish-coverage: - needs: build - runs-on: ubuntu-latest - steps: - - name: Coveralls finish - uses: coverallsapp/github-action@master - with: - parallel-finish: true - github-token: ${{ secrets.GITHUB_TOKEN }}