Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hashchecker fix + docs #44

Merged
merged 19 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
run: |
sudo ./dependencies.sh -yd
sudo ./configure.sh -yd
sudo sed -i 's/"immutable": true/"immutable": false/g' /etc/security/rootasrole.json
echo "/home/runner/.cargo/bin" >> $GITHUB_PATH
- name: Configure PAM
run: |
Expand All @@ -38,8 +39,12 @@ jobs:
- name: getenv
run: env
- name: Install Project
env:
PROFILE: debug
run: sudo -E make -e install
- name: Run Sr
env:
RUST_LOG: debug
run: /usr/bin/sr -h
- name: Run Chsr with sr
run: sr /usr/bin/chsr -h
34 changes: 12 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@ on:
jobs:
rust-coverage:
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: llvm-tools-preview
override: true

- name: Install grcov
run: cargo install grcov

- name: Update apt-get
run: apt update -y

- name: Install sudo
run: apt install sudo -y

- name: Install Dependencies
run: sudo ./dependencies.sh -yd
Expand All @@ -32,21 +31,12 @@ jobs:
run: sudo ./configure.sh -yd

- name: run tests with coverage
run: cargo test
env:
RUST_LOG: debug
CARGO_INCREMENTAL: 0
RUSTFLAGS: '-Cinstrument-coverage'
LLVM_PROFILE_FILE: 'cargo-test-%p-%m.profraw'
continue-on-error: true

- name: generate report
run: grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/debug/rootasrole.lcov

run: cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --bin chsr --bin sr --exclude-files capable* capable-ebpf/src/vmlinux.rs capable/src/main.rs build.rs --out Xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: target/debug/rootasrole.lcov
file: cobertura.xml
flags: unittests
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*.ll
*.pyc
*.profraw
*.info

# Linker output
*.ilk
Expand Down Expand Up @@ -66,3 +67,7 @@ bin/

# Rust crates
Cargo.lock

# Html results
*.html
*.xml
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pest_derive = "2.7.8"
phf = { version = "0.11.2", features = ["macros"] }
const_format = "0.2.32"
rpassword = "7.3.1"
hex = "0.4.3"

[dev-dependencies]
env_logger = "*"
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ install: build
test:
cargo test

cov:
cargo tarpaulin --bin chsr --bin sr --exclude-files capable* capable-ebpf/src/vmlinux.rs capable/src/main.rs build.rs --out Lcov --out Html

uninstall:
rm -f /usr/bin/sr
rm -f /usr/bin/chsr
Expand Down
Loading