summaryrefslogtreecommitdiff
path: root/.github/workflows/continuous-integration.yml
blob: 2a3e2739c52183c01c517d3498fbe92c676aa32d (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#
# Continuous Integration Workflow for libseccomp
#
# Copyright (c) 2021 Oracle and/or its affiliates.
# Author: Tom Hromatka <tom.hromatka@oracle.com>
#

#
# This library is free software; you can redistribute it and/or modify it
# under the terms of version 2.1 of the GNU Lesser General Public License as
# published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
# for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, see <http://www.gnu.org/licenses>.
#

name: Continuous Integration
on: ["push", "pull_request"]

jobs:
  tests:
    name: Tests
    runs-on: ubuntu-20.04

    steps:
    - name: Checkout from github
      uses: actions/checkout@v3
    - name: Initialize libseccomp
      uses: ./.github/actions/setup
    - name: Build libseccomp
      run: |
        ./configure --enable-python
        make check-build
    - name: Run tests
      run: |
        LIBSECCOMP_TSTCFG_JOBS=0 \
          LIBSECCOMP_TSTCFG_STRESSCNT=5 make check

  livetests:
    name: Live Tests
    runs-on: ubuntu-20.04

    steps:
    - name: Checkout from github
      uses: actions/checkout@v3
    - name: Initialize libseccomp
      uses: ./.github/actions/setup
    - name: Build libseccomp
      run: |
        ./configure --enable-python
        make check-build
    - name: Run live tests
      run: |
        LIBSECCOMP_TSTCFG_JOBS=0 \
          LIBSECCOMP_TSTCFG_TYPE=live \
          LIBSECCOMP_TSTCFG_MODE_LIST=c make -C tests check

  scanbuild:
    name: Scan Build
    runs-on: ubuntu-20.04

    steps:
    - name: Checkout from github
      uses: actions/checkout@v3
    - name: Initialize libseccomp
      uses: ./.github/actions/setup
    - name: Run scan-build
      run: |
        ./configure
        scan-build --status-bugs make

  codecoverage:
    name: Code Coverage
    runs-on: ubuntu-20.04

    steps:
    - name: Checkout from github
      uses: actions/checkout@v3
    - name: Initialize libseccomp
      uses: ./.github/actions/setup
    - name: Configure libseccomp
      run: |
        ./configure --enable-code-coverage
    - name: Run tests with code coverage enabled
      run: |
        LIBSECCOMP_TSTCFG_JOBS=0 \
          make test-code-coverage
    - name: Upload code coverage results
      uses: coverallsapp/github-action@master
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        path-to-lcov: ./libseccomp.lcov.info
        flag-name: "amd64"
    - name: Archive code coverage results
      if: ${{ always() }}
      uses: actions/upload-artifact@v3
      with:
        name: Code Coverage Artifacts
        path: |
          ./libseccomp.lcov.info
          ./libseccomp.lcov.html.d

  codespell:
    name: Codespell
    runs-on: ubuntu-20.04

    steps:
    - name: Checkout from github
      uses: actions/checkout@v3
    - name: Spellcheck
      uses: codespell-project/actions-codespell@master
      with:
        ignore_words_list: extraversion
        exclude_file: src/syscalls.csv