Skip to content

Commit 6c062c8

Browse files
committed
shuffle CI steps around for faster debugging
1 parent 8a03d54 commit 6c062c8

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

.github/workflows/bench-test.yaml

+27-27
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,6 @@ jobs:
2929
retry_on: error
3030
command: git clone https://gitee.com/openharmony/${{ matrix.project }}.git
3131

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-
5932
- name: initialize counters
6033
working-directory: ./${{ matrix.project }}
6134
run: |
@@ -111,6 +84,33 @@ jobs:
11184
echo ".iter_mut() occurrences: $iter_mut_count"
11285
echo ".into_iter() occurrences: $into_iter_count"
11386
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+
114114
- name: lint fix
115115
working-directory: ./${{ matrix.project }}
116116
continue-on-error: true

0 commit comments

Comments
 (0)