mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-12-01 07:04:09 +00:00
* ci: save release and dependency-check Rust caches only on main The macOS and Windows release builds and the dependency check saved Rust caches on every ref, including tags and PRs. Those caches are unreachable from other refs and evict main's caches. Save them only on main, and extend the cache policy test to every workflow and composite action. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * ci: correct the macOS rust-cache key comment Signed-off-by: Dennis Zhuang <killme2008@gmail.com> --------- Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
40 lines
992 B
YAML
40 lines
992 B
YAML
name: Check Dependencies
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
check-dependencies:
|
|
if: ${{ github.event.pull_request.draft == false }}
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Rust
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
cache: false
|
|
|
|
- name: Run cargo tree
|
|
run: cargo tree --prefix none > dependencies.txt
|
|
|
|
- name: Extract dependency names
|
|
run: awk '{print $1}' dependencies.txt > dependency_names.txt
|
|
|
|
- name: Check for blacklisted crates
|
|
run: |
|
|
while read -r dep; do
|
|
if grep -qFx "$dep" dependency_names.txt; then
|
|
echo "Blacklisted crate '$dep' found in dependencies."
|
|
exit 1
|
|
fi
|
|
done < .github/cargo-blacklist.txt
|
|
echo "No blacklisted crates found."
|