summaryrefslogtreecommitdiff
path: root/.github/workflows/coverage.yml
blob: f23424dc8e636212558b8083aa6aed85d3b09149 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
name: coverage

on:
  push:
    branches:
      - master
    paths-ignore:
      - '**.md'
      - '.mailmap'
      - 'ChangeLog*'
      - 'whatsnew*'
      - 'LICENSE'

jobs:
  linux:
    runs-on: ubuntu-18.04
    if: "!contains(github.event.head_commit.message, 'ci skip')"
    steps:
      - uses: actions/checkout@v2.0.0
      - name: Cache
        uses: actions/cache@v1.0.3
        with:
          path: build
          key: ${{ matrix.os }}-coverage-v2

      - name: Install Depends
        run: sudo apt install zlib1g-dev libssl-dev build-essential lcov libmbedtls-dev

      - name: Build
        shell: bash
        run: |
            export JOBS=20
            mkdir -p build
            cd build
            cmake .. -DEVENT__COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug
            make -j $JOBS

      - name: Test
        shell: bash
        run: |
            export CTEST_PARALLEL_LEVEL=$JOBS
            export CTEST_OUTPUT_ON_FAILURE=1
            cd build
            make verify_coverage

      - name: Coveralls GitHub Action
        uses: coverallsapp/github-action@v1.0.1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          path-to-lcov: ./build/coverage.info.cleaned

      - uses: actions/upload-artifact@v1
        if: failure()
        with:
          name: coverage-build
          path: build