Files
LibreQoS/.github/workflows/rust.yml
T
2026-03-30 11:26:36 -06:00

64 lines
2.0 KiB
YAML

name: Rust
on: [push]
jobs:
build:
runs-on: [ lq_run ]
steps:
- uses: actions/checkout@v4
- name: Set Version ENV
run: echo "VERSION=$(cat src/VERSION_STRING)" >> "$GITHUB_ENV"
- name: Check env var
run: |
echo ${{ env.VERSION }}
- name: Install dependencies
run: |
sudo /bin/apt-get update
sudo /bin/apt-get install --no-install-recommends \
python3-pip clang gcc gcc-multilib llvm libelf-dev graphviz esbuild \
pkg-config libbpf-dev mold unzip curl ca-certificates
BPFTOOL_VERSION="7.7.0"
case "$(uname -m)" in
x86_64) BPFTOOL_ARCH="amd64" ;;
aarch64) BPFTOOL_ARCH="arm64" ;;
*)
echo "Unsupported architecture for upstream bpftool binary: $(uname -m)" >&2
exit 1
;;
esac
BPFTOOL_TARBALL="bpftool-v${BPFTOOL_VERSION}-${BPFTOOL_ARCH}.tar.gz"
BPFTOOL_BASE_URL="https://github.com/libbpf/bpftool/releases/download/v${BPFTOOL_VERSION}"
curl -fsSLO "${BPFTOOL_BASE_URL}/${BPFTOOL_TARBALL}"
curl -fsSLO "${BPFTOOL_BASE_URL}/${BPFTOOL_TARBALL}.sha256sum"
sha256sum -c "${BPFTOOL_TARBALL}.sha256sum"
tar -xzf "${BPFTOOL_TARBALL}"
sudo install -m 0755 bpftool /usr/local/bin/bpftool
command -v bpftool
bpftool version
- name: Build
run: pushd src/rust; cargo build --verbose --all; popd
- name: Run tests
run: pushd src/rust; cargo test --verbose --all; popd
- name: Build .deb file
run: ./build_dpkg.sh --nostamp
working-directory: src/
- name: Archive .deb file
uses: actions/upload-artifact@v4
with:
name: libreqos_${{ env.VERSION }}.-1_amd64.deb
path: src/dist/libreqos_${{ env.VERSION }}.-1_amd64.deb
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install tools
run: pushd src/rust; cargo install cargo-audit; popd
- name: Audit for CVEs
run: cd src/rust; cargo audit -c always