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/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..b4f5493 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,81 @@ +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 + + - name: Generate coverage report + run: lcov -c -d . -o lcov.info + if: "matrix.CC == 'gcc'" + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + 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 }} 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.* 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..b2dc05e 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) +[![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