Skip to content

a good attempt

a good attempt #12

name: bench-test-github
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project:
[
BurntSushi/aho-corasick,
rust-lang/rust-bindgen,
dtolnay/cxx,
rust-bakery/nom,
sfackler/rust-openssl,
serde-rs/serde,
clap-rs/clap,
tokio-rs/tracing,
brendanzab/codespan,
rust-lang/regex,
dtolnay/syn,
]
steps:
- uses: actions/checkout@v4
with:
repository: "${{ matrix.project }}"
- name: Cache Cargo dependencies and binaries
uses: actions/cache@v4
with:
path: |
~/.cargo
key: ${{ runner.os }}-cargo-${{ matrix.project }}-v2
restore-keys: |
${{ runner.os }}-cargo-${{ matrix.project }}-v2
${{ runner.os }}-cargo-${{ matrix.project }}-
${{ runner.os }}-cargo-
- name: prepare repository for dylint
run: |
curl -o prepare_repo.sh https://raw.githubusercontent.com/trusted-programming/mate/main/scripts/prepare_repo.sh
bash prepare_repo.sh
- name: count occurrences before
run: |
curl -o counters.sh https://raw.githubusercontent.com/trusted-programming/mate/main/scripts/counters.sh
bash counters.sh before
- name: Lint fix (run 5 times)
continue-on-error: true
run: |
for i in {1..5}; do
cargo dylint --all --workspace --fix -- --allow-dirty --allow-no-vcs --broken-code --lib --bins
done
- name: cargo check
run: cargo check
- name: git diff for .rs files
if: always()
run: git diff -- '*.rs'
- name: count occurrences after
if: always()
run: bash counters.sh after
- name: Calculate and print differences
if: always()
run: |
echo "TOTAL OVERVIEW OF RESULTS"
echo ""
echo "For loop count before: $for_loop_count_before"
echo "For loop count after: $for_loop_count_after"
echo "For loop count difference: $((for_loop_count_after - for_loop_count_before))"
echo ""
echo "Iter count before: $iter_count_before"
echo "Iter count after: $iter_count_after"
echo "Iter count difference: $((iter_count_after - iter_count_before))"
echo ""
echo "Par iter count before: $par_iter_count_before"
echo "Par iter count after: $par_iter_count_after"
echo "Par iter count difference: $((par_iter_count_after - par_iter_count_before))"