summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorTom Hromatka <tom.hromatka@oracle.com>2020-12-02 12:22:08 -0700
committerPaul Moore <paul@paul-moore.com>2021-07-26 22:29:27 -0400
commitfe068413adf3956a96d63aade3dbf7d556afd877 (patch)
treecbbbed4d8b52ca3c366b7b60a4cd37974de3d40c /.github
parent947ecc884d5c503c08fd10d580cb6b353fa0f31a (diff)
downloadlibseccomp-fe068413adf3956a96d63aade3dbf7d556afd877.tar.gz
github: Add continuous integration workflow
Add Github Actions workflow and actions to run the automated libseccomp tests and gather code coverage metrics. Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to '.github')
-rw-r--r--.github/actions/setup/action.yml38
-rw-r--r--.github/workflows/continuous-integration.yml100
2 files changed, 138 insertions, 0 deletions
diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml
new file mode 100644
index 0000000..bfbba66
--- /dev/null
+++ b/.github/actions/setup/action.yml
@@ -0,0 +1,38 @@
+#
+# Github Action to setup the libcgroup directory
+#
+# 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: Setup the libseccomp directory
+description: "Install dependencies and configure libseccomp"
+runs:
+ using: "composite"
+ steps:
+ - run: sudo apt-get install -y build-essential valgrind clang-tools lcov gperf astyle codespell
+ shell: bash
+ - run: |
+ sudo apt-get install -y python3 python3-distutils python3-setuptools python3-pip
+ python3 -m pip install --upgrade pip
+ python3 -m pip install cython
+ # Add cython to the path
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
+ shell: bash
+ - run: |
+ ./autogen.sh
+ shell: bash
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
new file mode 100644
index 0000000..b253a91
--- /dev/null
+++ b/.github/workflows/continuous-integration.yml
@@ -0,0 +1,100 @@
+#
+# 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@v2
+ - name: Initialize libseccomp
+ uses: ./.github/actions/setup
+ - name: Build libseccomp
+ run: |
+ ./configure --enable-python
+ make check-build
+ - name: Run tests
+ run: LIBSECCOMP_TSTCFG_STRESSCNT=5 make check
+
+ livetests:
+ name: Live Tests
+ runs-on: ubuntu-20.04
+
+ steps:
+ - name: Checkout from github
+ uses: actions/checkout@v2
+ - name: Initialize libseccomp
+ uses: ./.github/actions/setup
+ - name: Build libseccomp
+ run: |
+ ./configure --enable-python
+ make check-build
+ - name: Run live tests
+ run: 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@v2
+ - 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@v2
+ - name: Initialize libseccomp
+ uses: ./.github/actions/setup
+ - name: Configure libseccomp
+ run: |
+ ./configure --enable-code-coverage
+ - name: Run tests with code coverage enabled
+ run: |
+ make test-code-coverage
+ - name: Gather code coverage results
+ run: lcov -c --exclude tests --exclude tools --exclude src/arch-syscall-check.c -d . -o lcov.info
+ - name: Upload code coverage results
+ uses: coverallsapp/github-action@master
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ path-to-lcov: ./lcov.info
+ flag-name: "amd64"
+ - name: Archive code coverage results
+ if: ${{ always() }}
+ uses: actions/upload-artifact@v2
+ with:
+ name: Code Coverage Artifacts
+ path: lcov.*