Skip to content

Commit c5ebfe8

Browse files
authored
Merge pull request #52 from RAprogramm/new_version
New version
2 parents fb4ec5d + 3af9f57 commit c5ebfe8

File tree

87 files changed

+10365
-975
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+10365
-975
lines changed

.cargo/audit.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[advisories]
2+
ignore = ["RUSTSEC-2023-0071"] # rsa / Marvin Attack; тянется опционально через sqlx-mysql, мы mysql не используем
3+
severity_threshold = "low"
4+
informational_warnings = ["unmaintained"] # опционально
5+

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[patch.crates-io]
2+
masterror-derive = { path = "masterror-derive" }
3+
masterror-template = { path = "masterror-template" }
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Cargo Deny Check"
2+
description: "Install and run cargo-deny against the workspace"
3+
inputs:
4+
version:
5+
description: "cargo-deny crate version to install"
6+
required: false
7+
default: "0.18.4"
8+
checks:
9+
description: "Space-separated list of cargo deny check types (leave empty to run all)"
10+
required: false
11+
default: "advisories bans licenses sources"
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Ensure cargo-deny
16+
shell: bash
17+
env:
18+
CARGO_DENY_VERSION: ${{ inputs.version }}
19+
run: |
20+
set -euo pipefail
21+
current_version=""
22+
if command -v cargo-deny >/dev/null 2>&1; then
23+
current_version="$(cargo-deny --version | awk '{print $2}')"
24+
fi
25+
if [ "$current_version" = "$CARGO_DENY_VERSION" ]; then
26+
echo "cargo-deny $CARGO_DENY_VERSION already installed"
27+
exit 0
28+
fi
29+
echo "Installing cargo-deny $CARGO_DENY_VERSION"
30+
cargo install cargo-deny --locked --force --version "$CARGO_DENY_VERSION"
31+
- name: Run cargo-deny
32+
shell: bash
33+
env:
34+
CHECKS: ${{ inputs.checks }}
35+
run: |
36+
set -euo pipefail
37+
if [ -z "${CHECKS// }" ]; then
38+
cargo-deny check
39+
else
40+
cargo-deny check ${CHECKS}
41+
fi

.github/workflows/reusable-ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ jobs:
182182
cargo +${{ steps.msrv.outputs.msrv }} clippy --workspace --all-targets -- -D warnings
183183
fi
184184
185+
- name: Cargo deny
186+
uses: ./.github/actions/cargo-deny
187+
185188
- name: Tests (MSRV)
186189
shell: bash
187190
run: |
@@ -192,6 +195,12 @@ jobs:
192195
cargo +${{ steps.msrv.outputs.msrv }} test --workspace --no-fail-fast
193196
fi
194197
198+
- name: Install cargo-audit
199+
run: cargo install --locked cargo-audit
200+
201+
- name: Security audit
202+
run: cargo audit --deny warnings
203+
195204
- name: Auto-commit README changes (any branch)
196205
if: always()
197206
run: |

.hooks/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ cargo clippy --workspace --all-targets --all-features -- -D warnings
1616
echo "🧪 Running tests (all features)..."
1717
cargo test --workspace --all-features
1818

19+
echo "🛡️ Running cargo audit..."
20+
if ! command -v cargo-audit >/dev/null 2>&1; then
21+
cargo install --locked cargo-audit >/dev/null
22+
fi
23+
cargo audit
24+
1925
# Uncomment if you want to validate SQLx offline data
2026
# echo "📦 Validating SQLx prepare..."
2127
# cargo sqlx prepare --check --workspace

0 commit comments

Comments
 (0)