Skip to content

Add cross-compilation to CI #455

Add cross-compilation to CI

Add cross-compilation to CI #455

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: 00 4 * * *
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
runner:
- ubuntu-latest # x86
rust:
- 1.80.1
program:
- kprobe
# - kretprobe
# - fentry
# - fexit
# - uprobe
# - uretprobe
# - sock_ops
# - socket_filter
# - sk_msg
# - xdp
# - cgroup_skb
# - cgroup_sockopt
# - cgroup_sysctl
# - classifier
# - lsm
# - perf_event
# - raw_tracepoint
# - tp_btf
# - tracepoint
include:
- runner: macos-13 # x86
rust: 1.80.1
program: kprobe
- runner: macos-14 # arm64
rust: 1.80.1
program: kprobe
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src,rustfmt
- uses: dtolnay/rust-toolchain@master
if: runner.os == 'macOS' && runner.arch == 'X64'
with:
toolchain: ${{ matrix.rust }}
targets: x86_64-unknown-linux-musl
components: clippy
- uses: dtolnay/rust-toolchain@master
if: runner.os == 'macOS' && runner.arch == 'ARM64'
with:
toolchain: ${{ matrix.rust }}
targets: aarch64-unknown-linux-musl
components: clippy
- uses: dtolnay/rust-toolchain@master
if: runner.os != 'macOS'
with:
toolchain: ${{ matrix.rust }}
components: clippy
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@v2
with:
tool: cargo-generate
- run: brew install filosottile/musl-cross/musl-cross llvm
if: runner.os == 'macos'
- run: cargo install bpf-linker --git https://github.com/aya-rs/bpf-linker.git --no-default-features
if: runner.os == 'macos'
- run: cargo install bpf-linker --git https://github.com/aya-rs/bpf-linker.git
if: runner.os != 'macos'
- uses: actions/setup-go@v5
with:
go-version: stable
- run: go run main.go ${{ github.workspace }} ${{ matrix.program }}