Skip to content

Unit test

Unit test #17

Workflow file for this run

name: Unit test
on:
workflow_dispatch:
pull_request:
push:
branches: [ main ]
permissions:
pull-requests: write
contents: write
repository-projects: write
jobs:
publich_pkg:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Build bcc
run: |
set -x
export BCC_TAG=$(cat bcc_tag)
sudo apt-get update
# Use release 9 of llvm etc. - later versions have an unfixed
# bug on Ubuntu:
# https://github.com/iovisor/bcc/issues/2915
sudo apt-get update
sudo apt-get -y install tar pbuilder aptitude bison build-essential cmake flex git libelf-dev libfl-dev libedit-dev libllvm11 llvm-11-dev libclang-cpp11-dev libclang-common-11-dev libclang1-11 libclang-11-dev python zlib1g-dev
git clone --depth 1 --branch ${BCC_TAG} https://github.com/iovisor/bcc.git
cd bcc
# Symlink /usr/lib/llvm to avoid "Unable to find clang libraries"
# The directory appears only to be created when installing the
# virtual llvm-dev package.
# https://github.com/iovisor/bcc/issues/492
sudo ln -s /usr/lib/llvm-11 /usr/local/llvm
sudo /usr/lib/pbuilder/pbuilder-satisfydepends
sudo ./scripts/build-deb.sh
sudo tar czvf /tmp/bcc_${BCC_TAG}.tar.gz *.deb
- name: Build xgboost
run: |
set -x
export XGBOOST_TAG=$(cat xgboost_tag)
sudo apt-get update -y
# ubuntu 20.04 ships with cmake 3.16, but xgboost needs 3.18+. Install cmake from pip
sudo apt-get install git make g++ python3-pip -y
sudo pip install cmake --upgrade
git clone --recursive https://github.com/dmlc/xgboost.git
cd xgboost && git checkout tags/v${XGBOOST_TAG} && mkdir -p build && cd build && cmake .. && make -j4 && make package && sudo tar czvf /tmp/xgboost-${XGBOOST_TAG}-Linux.sh.tar.gz xgboost-${XGBOOST_TAG}-Linux.sh
#- name: upload bcc deb artifact
# uses: actions/upload-artifact@v2
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# name: bcc.linux-amd64.tar.gz
# path: /tmp/bcc_*.tar.gz
- if: startsWith(github.event.ref, 'refs/tags/')
name: Release
uses: softprops/action-gh-release@master
with:
files: |
bcc.linux-amd64.tar.gz
/tmp/bcc_*.tar.gz
/tmp/xgboost-*.tar.gz