try fix CI dependency rayon add #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: bench-test | |
on: [push] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
request_request: | |
runs-on: ubuntu-latest | |
name: request_request | |
steps: | |
- name: clone repo | |
run: git clone https://gitee.com/openharmony/request_request.git | |
- name: install dylint | |
run: cargo install cargo-dylint dylint-link | |
- name: add Cargo.toml dylint lib link | |
working-directory: ./request_request | |
run: echo -e "\n[workspace.metadata.dylint]\nlibraries = [\n { git = \"https://github.com/trusted-programming/cargo-mate\"},\n]" >> Cargo.toml | |
- name: add rayon | |
working-directory: ./request_request | |
run: | | |
find . -type f -name "Cargo.toml" | while read -r file; do | |
# Check if rayon is already in the dependencies | |
if ! grep -qE "^rayon =" "$file"; then | |
# Add rayon under the [dependencies] line | |
sed -i '/\[dependencies\]/a rayon = "1.8.1"' "$file" | |
fi | |
done | |
- name: lint fix | |
working-directory: ./request_request | |
continue-on-error: true | |
run: cargo dylint --all --workspace --fix -- --allow-dirty --allow-no-vcs --broken-code --lib | |
- name: cargo check | |
working-directory: ./request_request | |
run: cargo check | |
- name: git diff | |
working-directory: ./request_request | |
run: git diff | |
commonlibrary_rust_ylong_runtime: | |
runs-on: ubuntu-latest | |
name: commonlibrary_rust_ylong_runtime | |
steps: | |
- name: clone repo | |
run: git clone https://gitee.com/openharmony/commonlibrary_rust_ylong_runtime.git | |
- name: install dylint | |
run: cargo install cargo-dylint dylint-link | |
- name: add Cargo.toml dylint lib link | |
working-directory: ./commonlibrary_rust_ylong_runtime | |
run: echo -e "\n[workspace.metadata.dylint]\nlibraries = [\n { git = \"https://github.com/trusted-programming/cargo-mate\"},\n]" >> Cargo.toml | |
- name: add rayon | |
working-directory: ./commonlibrary_rust_ylong_runtime | |
run: | | |
find . -type f -name "Cargo.toml" | while read -r file; do | |
# Check if rayon is already in the dependencies | |
if ! grep -qE "^rayon =" "$file"; then | |
# Add rayon under the [dependencies] line | |
sed -i '/\[dependencies\]/a rayon = "1.8.1"' "$file" | |
fi | |
done | |
- name: lint fix | |
working-directory: ./commonlibrary_rust_ylong_runtime | |
continue-on-error: true | |
run: cargo dylint --all --workspace --fix -- --allow-dirty --allow-no-vcs --broken-code --lib | |
- name: cargo check | |
working-directory: ./commonlibrary_rust_ylong_runtime | |
run: cargo check | |
- name: git diff | |
working-directory: ./commonlibrary_rust_ylong_runtime | |
run: git diff |