mirror of
https://github.com/Universal-Debloater-Alliance/universal-android-debloater-next-generation.git
synced 2026-08-09 07:09:12 +02:00
80 lines
2.5 KiB
YAML
80 lines
2.5 KiB
YAML
name: Continuous Integration
|
|
on:
|
|
push:
|
|
paths:
|
|
- Cargo.lock
|
|
- Cargo.toml
|
|
- resources/assets/*.ttf
|
|
- resources/assets/uad_lists.json
|
|
- src/**
|
|
pull_request:
|
|
paths:
|
|
- Cargo.lock
|
|
- Cargo.toml
|
|
- resources/assets/*.ttf
|
|
- resources/assets/uad_lists.json
|
|
- src/**
|
|
|
|
jobs:
|
|
lint:
|
|
name: lint
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-22.04, windows-2022, macOS-14]
|
|
lint: [check, test, clippy, fmt]
|
|
exclude: # https://github.com/community/community/discussions/7835
|
|
- os: windows-2022
|
|
lint: clippy
|
|
- os: windows-2022
|
|
lint: fmt
|
|
- os: macOS-14
|
|
lint: clippy
|
|
- os: macOS-14
|
|
lint: fmt
|
|
include:
|
|
- lint: check
|
|
args: " --all-features"
|
|
- lint: test
|
|
args: ""
|
|
- lint: clippy
|
|
args: " --all --all-features"
|
|
- lint: fmt
|
|
args: " --all -- --check"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: rui314/setup-mold@v1 # faster linker
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
target
|
|
key: ${{ runner.os }}-${{ matrix.lint }}-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: ${{ runner.OS }}-${{ matrix.lint }}-
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy,rustfmt
|
|
- run: cargo ${{ matrix.lint }}${{ matrix.args }}
|
|
|
|
coverage:
|
|
name: coverage
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Download grcov
|
|
run: |
|
|
mkdir -p "${HOME}/.local/bin"
|
|
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.19/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C "${HOME}/.local/bin"
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
- name: Install LLVM-profdata
|
|
run: rustup component add llvm-tools-preview
|
|
- name: Run tests
|
|
run: CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' cargo test
|
|
- name: make coverage directory
|
|
run: mkdir ./target/coverage
|
|
- name: Run GRCOV
|
|
run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o ./target/coverage/tests.lcov
|