-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Signed-off-by: Paul Moore <[email protected]>
- Loading branch information
1 parent
947ecc8
commit fe06841
Showing
2 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# | ||
# Github Action to setup the libcgroup directory | ||
# | ||
# Copyright (c) 2021 Oracle and/or its affiliates. | ||
# Author: Tom Hromatka <[email protected]> | ||
# | ||
|
||
# | ||
# 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:https://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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# | ||
# Continuous Integration Workflow for libseccomp | ||
# | ||
# Copyright (c) 2021 Oracle and/or its affiliates. | ||
# Author: Tom Hromatka <[email protected]> | ||
# | ||
|
||
# | ||
# 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:https://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.* |