@@ -8,7 +8,7 @@ concurrency:
8
8
jobs :
9
9
request_request :
10
10
runs-on : ubuntu-latest
11
- name : request_request
11
+ name : request_request
12
12
steps :
13
13
- name : clone repo
14
14
run : git clone https://gitee.com/openharmony/request_request.git
@@ -23,14 +23,19 @@ jobs:
23
23
- name : add rayon
24
24
working-directory : ./request_request
25
25
run : |
26
- cargo add rayon --package request
27
- cargo add rayon --package download_server
28
-
26
+ find . -type f -name "Cargo.toml" | while read -r file; do
27
+ # Check if rayon is already in the dependencies
28
+ if ! grep -qE "^rayon =" "$file"; then
29
+ # Add rayon under the [dependencies] line
30
+ sed -i '/\[dependencies\]/a rayon = "1.8.1"' "$file"
31
+ fi
32
+ done
33
+
29
34
- name : lint fix
30
35
working-directory : ./request_request
31
36
continue-on-error : true
32
- run : cargo dylint --all --workspace --fix -- --allow-dirty --allow-no-vcs --broken-code --lib
33
-
37
+ run : cargo dylint --all --workspace --fix -- --allow-dirty --allow-no-vcs --broken-code --lib
38
+
34
39
- name : cargo check
35
40
working-directory : ./request_request
36
41
run : cargo check
@@ -56,20 +61,23 @@ jobs:
56
61
- name : add rayon
57
62
working-directory : ./commonlibrary_rust_ylong_runtime
58
63
run : |
59
- cargo add rayon --package ylong_runtime
60
- cargo add rayon --package ylong_ffrt
61
- cargo add rayon --package ylong_io
62
- cargo add rayon --package ylong_runtime_macros
63
-
64
+ find . -type f -name "Cargo.toml" | while read -r file; do
65
+ # Check if rayon is already in the dependencies
66
+ if ! grep -qE "^rayon =" "$file"; then
67
+ # Add rayon under the [dependencies] line
68
+ sed -i '/\[dependencies\]/a rayon = "1.8.1"' "$file"
69
+ fi
70
+ done
71
+
64
72
- name : lint fix
65
73
working-directory : ./commonlibrary_rust_ylong_runtime
66
74
continue-on-error : true
67
- run : cargo dylint --all --workspace --fix -- --allow-dirty --allow-no-vcs --broken-code --lib
68
-
75
+ run : cargo dylint --all --workspace --fix -- --allow-dirty --allow-no-vcs --broken-code --lib
76
+
69
77
- name : cargo check
70
78
working-directory : ./commonlibrary_rust_ylong_runtime
71
79
run : cargo check
72
80
73
81
- name : git diff
74
82
working-directory : ./commonlibrary_rust_ylong_runtime
75
- run : git diff
83
+ run : git diff
0 commit comments