-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (75 loc) · 2.66 KB
/
bench-test-github.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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,
huggingface/candle,
]
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))"