|
29 | 29 | retry_on: error
|
30 | 30 | command: git clone https://gitee.com/openharmony/${{ matrix.project }}.git
|
31 | 31 |
|
32 |
| - - name: install dylint |
33 |
| - run: cargo install cargo-dylint dylint-link |
34 |
| - |
35 |
| - - name: add Cargo.toml dylint lib link |
36 |
| - working-directory: ./${{ matrix.project }} |
37 |
| - run: echo -e "\n[workspace.metadata.dylint]\nlibraries = [\n { git = \"https://github.com/trusted-programming/cargo-mate\"},\n]" >> Cargo.toml |
38 |
| - |
39 |
| - - name: add rayon |
40 |
| - working-directory: ./${{ matrix.project }} |
41 |
| - shell: bash |
42 |
| - run: | |
43 |
| - find . -type f -name "Cargo.toml" | while read -r file; do |
44 |
| - # Check if there is a [package] section in the file |
45 |
| - if grep -qE "^\[package\]" "$file"; then |
46 |
| - # Check if rayon is already in the dependencies |
47 |
| - if ! grep -qE "^rayon =" "$file"; then |
48 |
| - # Check if [dependencies] section exists |
49 |
| - if ! grep -qE "^\[dependencies\]" "$file"; then |
50 |
| - # Add [dependencies] section at the end of the file |
51 |
| - echo -e "\n[dependencies]" >> "$file" |
52 |
| - fi |
53 |
| - # Add rayon under the [dependencies] line |
54 |
| - sed -i '/\[dependencies\]/a rayon = "1.8.1"' "$file" |
55 |
| - fi |
56 |
| - fi |
57 |
| - done |
58 |
| -
|
59 | 32 | - name: initialize counters
|
60 | 33 | working-directory: ./${{ matrix.project }}
|
61 | 34 | run: |
|
@@ -111,6 +84,33 @@ jobs:
|
111 | 84 | echo ".iter_mut() occurrences: $iter_mut_count"
|
112 | 85 | echo ".into_iter() occurrences: $into_iter_count"
|
113 | 86 |
|
| 87 | + - name: add Cargo.toml dylint lib link |
| 88 | + working-directory: ./${{ matrix.project }} |
| 89 | + run: echo -e "\n[workspace.metadata.dylint]\nlibraries = [\n { git = \"https://github.com/trusted-programming/cargo-mate\"},\n]" >> Cargo.toml |
| 90 | + |
| 91 | + - name: add rayon |
| 92 | + working-directory: ./${{ matrix.project }} |
| 93 | + shell: bash |
| 94 | + run: | |
| 95 | + find . -type f -name "Cargo.toml" | while read -r file; do |
| 96 | + # Check if there is a [package] section in the file |
| 97 | + if grep -qE "^\[package\]" "$file"; then |
| 98 | + # Check if rayon is already in the dependencies |
| 99 | + if ! grep -qE "^rayon =" "$file"; then |
| 100 | + # Check if [dependencies] section exists |
| 101 | + if ! grep -qE "^\[dependencies\]" "$file"; then |
| 102 | + # Add [dependencies] section at the end of the file |
| 103 | + echo -e "\n[dependencies]" >> "$file" |
| 104 | + fi |
| 105 | + # Add rayon under the [dependencies] line |
| 106 | + sed -i '/\[dependencies\]/a rayon = "1.8.1"' "$file" |
| 107 | + fi |
| 108 | + fi |
| 109 | + done |
| 110 | +
|
| 111 | + - name: install dylint |
| 112 | + run: cargo install cargo-dylint dylint-link |
| 113 | + |
114 | 114 | - name: lint fix
|
115 | 115 | working-directory: ./${{ matrix.project }}
|
116 | 116 | continue-on-error: true
|
|
0 commit comments