CI for FreeBSD (#754)
* CI for FreeBSD * rustup -y? * fixed path, switched to clippy * bsd don't source * added llvm * clippy * more yml * ? * testing ci * llvm? * llvm?? * more llvm, more tests * fixed testcase' * mem limits * more sudo * reenable all the CI
This commit is contained in:
parent
ebfe414a27
commit
c4e0faabc2
33
.github/workflows/build_and_test.yml
vendored
33
.github/workflows/build_and_test.yml
vendored
@ -279,3 +279,36 @@ jobs:
|
||||
# run: clang -v
|
||||
#- name: Windows Test
|
||||
# run: C:\Rust\.cargo\bin\cargo.exe test --verbose
|
||||
|
||||
freebsd:
|
||||
runs-on: macos-12
|
||||
name: Simple build in FreeBSD
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Test in FreeBSD
|
||||
id: test
|
||||
uses: vmactions/freebsd-vm@v0
|
||||
with:
|
||||
usesh: true
|
||||
sync: rsync
|
||||
copyback: false
|
||||
mem: 2048
|
||||
release: 13.1
|
||||
prepare: |
|
||||
pkg install -y curl bash sudo llvm14
|
||||
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||
|
||||
run: |
|
||||
freebsd-version
|
||||
. "$HOME/.cargo/env"
|
||||
rustup toolchain install nightly
|
||||
export LLVM_CONFIG=/usr/local/bin/llvm-config14
|
||||
pwd
|
||||
ls -lah
|
||||
echo "local/bin"
|
||||
ls -lah /usr/local/bin/
|
||||
which llvm-config
|
||||
chmod +x ./scripts/clippy.sh
|
||||
bash ./scripts/shmem_limits_fbsd.sh
|
||||
bash ./scripts/clippy.sh
|
||||
cargo test
|
||||
|
@ -666,11 +666,6 @@ mod freebsd {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_freebsd_get_affinity_mask() {
|
||||
get_affinity_mask().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_freebsd_set_for_current() {
|
||||
let ids = get_core_ids().unwrap();
|
||||
@ -679,25 +674,8 @@ mod freebsd {
|
||||
|
||||
ids[0].set_affinity().unwrap();
|
||||
|
||||
// Ensure that the system pinned the current thread
|
||||
// TODO: Ensure that the system pinned the current thread
|
||||
// to the specified core.
|
||||
let mut core_mask = new_cpuset();
|
||||
unsafe { CPU_SET(ids[0].id, &mut core_mask) };
|
||||
|
||||
let new_mask = get_affinity_mask().unwrap();
|
||||
|
||||
let mut is_equal = true;
|
||||
|
||||
for i in 0..CPU_SETSIZE as usize {
|
||||
let is_set1 = unsafe { CPU_ISSET(i, &core_mask) };
|
||||
let is_set2 = unsafe { CPU_ISSET(i, &new_mask) };
|
||||
|
||||
if is_set1 != is_set2 {
|
||||
is_equal = false;
|
||||
}
|
||||
}
|
||||
|
||||
assert!(is_equal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ impl ConfigTarget for Command {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(trivial_numeric_casts)]
|
||||
#[allow(trivial_numeric_casts, clippy::cast_possible_wrap)]
|
||||
fn setlimit(&mut self, memlimit: u64) -> &mut Self {
|
||||
if memlimit == 0 {
|
||||
return self;
|
||||
|
Loading…
x
Reference in New Issue
Block a user