-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into merge
- Loading branch information
Showing
496 changed files
with
162,965 additions
and
3,104 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,105 @@ | ||
name: Publish Build Artifacts | ||
|
||
on: push | ||
|
||
jobs: | ||
publish_images: | ||
# Optionally publish container images, guarded by the GitHub secret | ||
# QUAY_PUBLISH. | ||
# To set this up, sign up for quay.io (you can connect it to your github) | ||
# then create a robot user with write access user called "bcc_buildbot", | ||
# and add the secret token for it to GitHub secrets as: | ||
# - QUAY_TOKEN = <token from quay.io> | ||
name: Publish to quay.io | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
env: | ||
- NAME: xenial-release | ||
OS_RELEASE: 16.04 | ||
- NAME: bionic-release | ||
OS_RELEASE: 18.04 | ||
- NAME: focal-release | ||
OS_RELEASE: 20.04 | ||
steps: | ||
|
||
- uses: actions/checkout@v1 | ||
|
||
- name: Initialize workflow variables | ||
id: vars | ||
shell: bash | ||
run: | | ||
if [ -n "${QUAY_TOKEN}" ];then | ||
echo "Quay token is set, will push an image" | ||
echo ::set-output name=QUAY_PUBLISH::true | ||
else | ||
echo "Quay token not set, skipping" | ||
fi | ||
env: | ||
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} | ||
|
||
- name: Authenticate with quay.io docker registry | ||
if: > | ||
steps.vars.outputs.QUAY_PUBLISH | ||
env: | ||
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} | ||
run: ./scripts/docker/auth.sh ${{ github.repository }} | ||
|
||
- name: Package docker image and push to quay.io | ||
if: > | ||
steps.vars.outputs.QUAY_PUBLISH | ||
run: > | ||
./scripts/docker/push.sh | ||
${{ github.repository }} | ||
${{ github.ref }} | ||
${{ github.sha }} | ||
${{ matrix.env['NAME'] }} | ||
${{ matrix.env['OS_RELEASE'] }} | ||
# Uploads the packages built in docker to the github build as an artifact for convenience | ||
- uses: actions/upload-artifact@v1 | ||
if: > | ||
steps.vars.outputs.QUAY_PUBLISH | ||
with: | ||
name: ${{ matrix.env['NAME'] }} | ||
path: output | ||
|
||
# Optionally publish container images to custom docker repository, | ||
# guarded by presence of all required github secrets. | ||
# GitHub secrets can be configured as follows: | ||
# - DOCKER_IMAGE = docker.io/myorg/bcc | ||
# - DOCKER_USERNAME = username | ||
# - DOCKER_PASSWORD = password | ||
publish_dockerhub: | ||
name: Publish To Dockerhub | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v1 | ||
|
||
- name: Initialize workflow variables | ||
id: vars | ||
shell: bash | ||
run: | | ||
if [ -n "${DOCKER_IMAGE}" ] && \ | ||
[ -n "${DOCKER_USERNAME}" ] && \ | ||
[ -n "${DOCKER_PASSWORD}" ];then | ||
echo "Custom docker credentials set, will push an image" | ||
echo ::set-output name=DOCKER_PUBLISH::true | ||
else | ||
echo "Custom docker credentials not, skipping" | ||
fi | ||
- name: Build container image and publish to registry | ||
id: publish-registry | ||
uses: elgohr/[email protected] | ||
if: ${{ steps.vars.outputs.DOCKER_PUBLISH }} | ||
with: | ||
name: ${{ secrets.DOCKER_IMAGE }} | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
workdir: . | ||
dockerfile: Dockerfile.ubuntu | ||
snapshot: true | ||
cache: ${{ github.event_name != 'schedule' }} |
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,94 @@ | ||
name: BCC Build and tests | ||
|
||
on: push | ||
|
||
jobs: | ||
test_bcc: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-16.04, ubuntu-18.04] # 16.04.4 release has 4.15 kernel | ||
# 18.04.3 release has 5.0.0 kernel | ||
env: | ||
- TYPE: Debug | ||
PYTHON_TEST_LOGFILE: critical.log | ||
- TYPE: Release | ||
PYTHON_TEST_LOGFILE: critical.log | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: System info | ||
run: | | ||
uname -a | ||
ip addr | ||
- name: Build docker container with all deps | ||
run: | | ||
docker build -t bcc-docker -f Dockerfile.tests . | ||
- name: Run bcc build | ||
env: ${{ matrix.env }} | ||
run: | | ||
/bin/bash -c \ | ||
"docker run --privileged \ | ||
--pid=host \ | ||
-v $(pwd):/bcc \ | ||
-v /sys/kernel/debug:/sys/kernel/debug:rw \ | ||
-v /lib/modules:/lib/modules:ro \ | ||
-v /usr/src:/usr/src:ro \ | ||
-v /usr/include/linux:/usr/include/linux:ro \ | ||
bcc-docker \ | ||
/bin/bash -c \ | ||
'mkdir -p /bcc/build && cd /bcc/build && \ | ||
cmake -DCMAKE_BUILD_TYPE=${TYPE} .. && make -j9'" | ||
- name: Run bcc's cc tests | ||
env: ${{ matrix.env }} | ||
# tests are wrapped with `script` as a hack to get a TTY as github actions doesn't provide this | ||
# see https://github.com/actions/runner/issues/241 | ||
run: | | ||
script -e -c /bin/bash -c \ | ||
"docker run -ti \ | ||
--privileged \ | ||
--network=host \ | ||
--pid=host \ | ||
-v $(pwd):/bcc \ | ||
-v /sys/kernel/debug:/sys/kernel/debug:rw \ | ||
-v /lib/modules:/lib/modules:ro \ | ||
-v /usr/src:/usr/src:ro \ | ||
-e CTEST_OUTPUT_ON_FAILURE=1 \ | ||
bcc-docker \ | ||
/bin/bash -c \ | ||
'/bcc/build/tests/wrapper.sh \ | ||
c_test_all sudo /bcc/build/tests/cc/test_libbcc'" | ||
- name: Run all tests | ||
env: ${{ matrix.env }} | ||
run: | | ||
script -e -c /bin/bash -c \ | ||
"docker run -ti \ | ||
--privileged \ | ||
--network=host \ | ||
--pid=host \ | ||
-v $(pwd):/bcc \ | ||
-v /sys/kernel/debug:/sys/kernel/debug:rw \ | ||
-v /lib/modules:/lib/modules:ro \ | ||
-v /usr/src:/usr/src:ro \ | ||
-e CTEST_OUTPUT_ON_FAILURE=1 \ | ||
bcc-docker \ | ||
/bin/bash -c \ | ||
'cd /bcc/build && \ | ||
make test PYTHON_TEST_LOGFILE=$PYTHON_TEST_LOGFILE ARGS=-V'" | ||
- name: Check critical tests | ||
env: ${{ matrix.env }} | ||
run: | | ||
critical_count=$(grep @mayFail tests/python/critical.log | wc -l) | ||
echo "There were $critical_count critical tests skipped with @mayFail:" | ||
grep -A2 @mayFail tests/python/critical.log | ||
- uses: actions/upload-artifact@v1 | ||
with: | ||
name: critical-tests-${{ matrix.env['TYPE'] }}-${{ matrix.os }} | ||
path: tests/python/critical.log | ||
|
||
# To debug weird issues, you can add this step to be able to SSH to the test environment | ||
# https://github.com/marketplace/actions/debugging-with-tmate | ||
# - name: Setup tmate session | ||
# uses: mxschmitt/action-tmate@v1 |
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
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 |
---|---|---|
@@ -1,8 +1,20 @@ | ||
language: generic | ||
install: | ||
- sudo apt-get install -y python-pip | ||
- sudo pip install pep8 | ||
script: | ||
- set -euo pipefail | ||
- ./scripts/check-helpers.sh | ||
- ./scripts/py-style-check.sh | ||
language: python | ||
matrix: | ||
include: | ||
- name: "Check helpers on Python 2.7" | ||
python: 2.7 | ||
script: ./scripts/check-helpers.sh | ||
- name: "Python style check on Python 2.7" | ||
python: 2.7 | ||
script: ./scripts/py-style-check.sh | ||
- name: "flake8 lint on Python 2.7" | ||
python: 2.7 | ||
script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
- name: "flake8 lint on Python 3.7" | ||
dist: xenial # required for Python >= 3.7 | ||
python: 3.7 | ||
script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
allow_failures: | ||
- name: "Check helpers on Python 2.7" | ||
before_install: pip install --upgrade pip | ||
install: pip install flake8 |
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
Oops, something went wrong.