Skip to content

Instantly share code, notes, and snippets.

@chadbrewbaker
Created March 14, 2021 19:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chadbrewbaker/64c561cf74a07243c762d43f4b67e436 to your computer and use it in GitHub Desktop.
Save chadbrewbaker/64c561cf74a07243c762d43f4b67e436 to your computer and use it in GitHub Desktop.
Example for eBPF profiling on Github Actions
name: CICD
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
matrix:
job:
# { os, target, cargo-options, features, use-cross, toolchain }
# - { os: ubuntu-latest , target: arm-unknown-linux-gnueabihf , features: feat_os_unix_gnueabihf , use-cross: use-cross }
- { os: ubuntu-20.04 , target: x86_64-unknown-linux-gnu , features: feat_os_unix, use-cross: use-cross }
# - { os: ubuntu-16.04 , target: x86_64-unknown-linux-gnu , features: feat_os_unix , use-cross: use-cross }
# - { os: ubuntu-18.04 , target: i586-unknown-linux-gnu , features: feat_os_unix , use-cross: use-cross } ## note: older windows platform; not required, dev-FYI only
# - { os: ubuntu-18.04 , target: i586-unknown-linux-gnu , features: feat_os_unix , use-cross: use-cross } ## note: older windows platform; not required, dev-FYI only
# - { os: ubuntu-18.04 , target: i686-unknown-linux-gnu , features: feat_os_unix , use-cross: use-cross }
# - { os: ubuntu-18.04 , target: i686-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross }
# - { os: ubuntu-18.04 , target: x86_64-unknown-linux-gnu , features: feat_os_unix , use-cross: use-cross }
# - { os: ubuntu-18.04 , target: x86_64-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross }
# - { os: macos-latest , target: x86_64-apple-darwin , features: feat_os_macos }
# - { os: windows-latest , target: i686-pc-windows-gnu , features: feat_os_windows }
# - { os: windows-latest , target: i686-pc-windows-msvc , features: feat_os_windows }
# - { os: windows-latest , target: x86_64-pc-windows-gnu , features: feat_os_windows } ## note: requires rust >= 1.43.0 to link correctly
# - { os: windows-latest , target: x86_64-pc-windows-msvc , features: feat_os_windows }
steps:
- uses: actions/checkout@v1
- name: Install/setup prerequisites
shell: bash
run: |
echo "uname -a"
uname -a
echo "pwd"
pwd
sudo apt-get -y install bpfcc-tools linux-headers-$(uname -r)
sudo /usr/sbin/profile-bpfcc -adf -F 99 > my_file.txt
git clone https://github.com/uutils/coreutils
cd coreutils
cargo test
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: my-artifact
path: my_file.txt
retention-days: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment