mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2026-10-31 16:37:42 -05:00
changes
This commit is contained in:
1 parent
edd45f7ef5
commit
8abe2808f3
2 files changed
+37
-14
No files matched your search
@@ -4,23 +4,17 @@ on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
runs-on: [ lq_run ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set Version ENV
|
||||
run: pushd src; echo "::set-env name=VERSION::$(cat VERSION_STRING)"
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
||||
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 git nano graphviz esbuild curl screen llvm pkg-config linux-tools-common linux-tools-`/bin/uname r` libbpf-dev mold curl unzip
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
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 bpftool libbpf-dev mold unzip
|
||||
- name: Build
|
||||
run: pushd src/rust; cargo build --verbose --all; popd
|
||||
- name: Run tests
|
||||
@@ -35,13 +29,10 @@ jobs:
|
||||
path: src/dist/libreqos_${{ env.VERSION }}.-1_amd64.deb
|
||||
|
||||
audit:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install tools
|
||||
run: pushd src/rust; cargo install cargo-audit; popd
|
||||
- name: Audit for CVEs
|
||||
|
||||
@@ -32,6 +32,37 @@ fn command_warnings_errors_only(section: &str, command_result: &std::io::Result<
|
||||
}
|
||||
}
|
||||
|
||||
fn require_successful_output(section: &str, command_result: std::io::Result<Output>) -> Output {
|
||||
match command_result {
|
||||
Ok(output) => {
|
||||
if !output.stderr.is_empty() {
|
||||
println!(
|
||||
"cargo:warning=[{section}] {}",
|
||||
String::from_utf8_lossy(&output.stderr)
|
||||
);
|
||||
}
|
||||
|
||||
if !output.status.success() {
|
||||
panic!(
|
||||
"{section} failed with status {}",
|
||||
output
|
||||
.status
|
||||
.code()
|
||||
.map_or_else(|| "signal".to_string(), |code| code.to_string())
|
||||
);
|
||||
}
|
||||
|
||||
output
|
||||
}
|
||||
Err(error) => {
|
||||
panic!(
|
||||
"{section} is required to build lqos_sys but was not available: {error}. \
|
||||
Install bpftool (or provide it in PATH) before building."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let out_dir = env::var_os("OUT_DIR").unwrap();
|
||||
|
||||
@@ -84,7 +115,8 @@ fn main() {
|
||||
.args(["gen", "skeleton", &link_target])
|
||||
.output();
|
||||
command_warnings_errors_only("bpf skel", &skel_result);
|
||||
let header_file = String::from_utf8(skel_result.unwrap().stdout).unwrap();
|
||||
let skel_output = require_successful_output("bpftool gen skeleton", skel_result);
|
||||
let header_file = String::from_utf8(skel_output.stdout).unwrap();
|
||||
std::fs::write(skel_target, header_file).unwrap();
|
||||
|
||||
// 4: Copy the wrapper to our out dir
|
||||
|
||||
Reference in new issue
Block a user