-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #600 from DataDog/amaan.qureshi/K9VULN-2634
[K9VULN-2634] Check in Cargo.lock, and pass in `--locked` to cargo commands
- Loading branch information
Showing
20 changed files
with
4,924 additions
and
44 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,8 @@ jobs: | |
- { os: macos-latest, target: aarch64-apple-darwin, gha_alias: 'macOS aarch64 - ' } | ||
- { os: windows-latest, target: x86_64-pc-windows-msvc, gha_alias: 'Windows x64 - ' } | ||
cargo_cmd: | ||
- { cmd_name: build, gha_alias: "Build - Profile 'debug'" } | ||
- { cmd_name: test, args: '--workspace', gha_alias: "Test" } | ||
- { cmd_name: build, args: '--locked' , gha_alias: "Build - Profile 'debug'" } | ||
- { cmd_name: test, args: '--workspace --locked', gha_alias: "Test" } | ||
include: | ||
- config: { os: ubuntu-latest, target: aarch64-unknown-linux-gnu, gha_alias: '' } | ||
cargo_cmd: { cmd_name: clippy, args: '', gha_alias: "Clippy" } | ||
|
@@ -30,19 +30,32 @@ jobs: | |
DD_APP_KEY: ${{ secrets.DD_APP_KEY }} | ||
DD_SITE: ${{ vars.DD_SITE }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Rust | ||
uses: actions-rust-lang/[email protected] | ||
|
||
- name: Fetch dependencies | ||
run: cargo fetch | ||
|
||
- name: Run cargo ${{ matrix.cargo_cmd.cmd_name }} ${{ matrix.cargo_cmd.args }} | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: ${{ matrix.cargo_cmd.cmd_name }} | ||
args: ${{ matrix.cargo_cmd.args }} | ||
|
||
- name: Check the lockfile is up to date | ||
if: ${{ matrix.config.target == 'aarch64-unknown-linux-gnu' }} | ||
run: | | ||
cargo check | ||
git diff --exit-code Cargo.lock || (echo "::error::Lockfile is out of date. Please run 'cargo check' and commit the updated Cargo.lock file." && exit 1) | ||
- name: Check python rulesets - part1 | ||
run: cargo run --bin datadog-static-analyzer-test-ruleset -- -r python-best-practices -r python-security -r python-code-style -r python-inclusive | ||
run: cargo run --locked --bin datadog-static-analyzer-test-ruleset -- -r python-best-practices -r python-security -r python-code-style -r python-inclusive | ||
- name: Check python rulesets - part2 | ||
run: cargo run --bin datadog-static-analyzer-test-ruleset -- -r python-django -r python-flask -r python-design | ||
run: cargo run --locked --bin datadog-static-analyzer-test-ruleset -- -r python-django -r python-flask -r python-design | ||
- name: Check Java rulesets | ||
run: cargo run --bin datadog-static-analyzer-test-ruleset -- -r java-security -r java-best-practices -r java-code-style | ||
run: cargo run --locked --bin datadog-static-analyzer-test-ruleset -- -r java-security -r java-best-practices -r java-code-style | ||
- name: Check Docker rulesets | ||
run: cargo run --bin datadog-static-analyzer-test-ruleset -- -r docker-best-practices | ||
run: cargo run --locked --bin datadog-static-analyzer-test-ruleset -- -r docker-best-practices |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,34 +54,47 @@ jobs: | |
env: | ||
DD_SITE: datadoghq.com | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Rust | ||
uses: actions-rust-lang/[email protected] | ||
with: | ||
components: clippy | ||
|
||
- name: Fetch dependencies | ||
run: cargo fetch | ||
|
||
- name: Test all production rules | ||
run: | | ||
cargo build --profile release-dev --bin datadog-static-analyzer && \ | ||
cargo build --profile release-dev --bin datadog-static-analyzer-server && \ | ||
cargo build --locked --profile release-dev --bin datadog-static-analyzer && \ | ||
cargo build --locked --profile release-dev --bin datadog-static-analyzer-server && \ | ||
sudo apt-get install python3-requests && \ | ||
for language in ${{ needs.extract-languages.outputs.languages }}; do \ | ||
python misc/test-rules.py -c $PWD/target/release-dev/datadog-static-analyzer -s $PWD/target/release-dev/datadog-static-analyzer-server -l $language ; \ | ||
done | ||
staging_rules: | ||
needs: extract-languages | ||
runs-on: ubuntu-latest | ||
env: | ||
DD_SITE: datad0g.com | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Rust | ||
uses: actions-rust-lang/[email protected] | ||
with: | ||
components: clippy | ||
|
||
- name: Fetch dependencies | ||
run: cargo fetch | ||
|
||
- name: Test all staging rules | ||
run: | | ||
cargo build --profile release-dev --bin datadog-static-analyzer && \ | ||
cargo build --profile release-dev --bin datadog-static-analyzer-server && \ | ||
cargo build --locked --profile release-dev --bin datadog-static-analyzer && \ | ||
cargo build --locked --profile release-dev --bin datadog-static-analyzer-server && \ | ||
sudo apt-get install python3-requests && \ | ||
for language in ${{ needs.extract-languages.outputs.languages }}; do \ | ||
python misc/test-rules.py -c $PWD/target/release-dev/datadog-static-analyzer -s $PWD/target/release-dev/datadog-static-analyzer-server -l $language ; \ | ||
|
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
Oops, something went wrong.