2023-11-19 23:35:03 +08:00
|
|
|
name: dependencies
|
|
|
|
|
|
|
|
on:
|
2023-12-01 02:06:27 +08:00
|
|
|
schedule:
|
|
|
|
- cron: '0 21 * * TUE' # Run every Tuesday at 21:00 (UTC)
|
2023-11-19 23:35:03 +08:00
|
|
|
push:
|
2023-12-01 02:06:27 +08:00
|
|
|
tags:
|
2023-12-12 22:42:33 +08:00
|
|
|
- 'v*.*.*' # Run when a new version is being published
|
2023-11-19 23:35:03 +08:00
|
|
|
|
2024-02-06 23:06:12 +08:00
|
|
|
env:
|
|
|
|
#
|
|
|
|
# Dependency versioning
|
|
|
|
#
|
|
|
|
|
|
|
|
# Udeps version
|
|
|
|
UDEPS_VERSION: "0.1.143"
|
|
|
|
|
2023-11-19 23:35:03 +08:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
dependencies:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Audit Rust dependencies
|
2023-12-12 22:42:33 +08:00
|
|
|
# If a vulnerability is found, a new issue will automatically be opened
|
|
|
|
# since this action runs on main branch
|
2023-11-19 23:35:03 +08:00
|
|
|
uses: actions-rust-lang/audit@v1
|
|
|
|
|
|
|
|
- name: Detect multiple versions of the same crate
|
2024-08-05 23:43:58 +08:00
|
|
|
uses: EmbarkStudios/cargo-deny-action@v2
|
2023-11-19 23:35:03 +08:00
|
|
|
with:
|
|
|
|
command: check bans licenses sources
|
|
|
|
|
|
|
|
- name: Install Rust nightly
|
|
|
|
uses: dtolnay/rust-toolchain@nightly
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
components: rustfmt
|
|
|
|
|
2023-12-01 02:06:27 +08:00
|
|
|
- name: Install cargo-udeps
|
|
|
|
env:
|
|
|
|
UDEPS_LINK: https://github.com/est31/cargo-udeps/releases/download
|
|
|
|
run: |
|
2024-02-06 23:06:12 +08:00
|
|
|
curl -L "$UDEPS_LINK/v$UDEPS_VERSION/cargo-udeps-v$UDEPS_VERSION-x86_64-unknown-linux-gnu.tar.gz" |
|
2023-12-01 02:06:27 +08:00
|
|
|
tar xz -C $HOME/.cargo/bin --strip-components 2
|
|
|
|
|
|
|
|
- name: Run cargo-udeps
|
|
|
|
run: |
|
|
|
|
cargo +nightly udeps --all-targets
|