Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add azure CI snippet for dart-analyze #20

Merged
merged 3 commits into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions analyzers/dart-analyze/CI/azure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
trigger:
- "*"

pool:
vmImage: "ubuntu-latest"

stages:
- stage: scan_and_report
jobs:
- job: scan_and_report
displayName: "Scan and Report"
steps:
- script: |
sudo apt-get update
sudo apt-get install apt-transport-https
wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor -o /usr/share/keyrings/dart.gpg
echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list
sudo apt-get update
sudo apt-get install -y dart
displayName: "Setup Dart"

- checkout: self
displayName: "Code checkout"

- script: |
dart analyze > dart_analyze.txt || true
displayName: "Run dart analyze"

- script: |
curl -sSL https://raw.githubusercontent.com/advanced-security/dart-analyzer-sarif/main/dart_analyzer_sarif.py > dart-analyzer-sarif
python3 dart-analyzer-sarif dart_analyze.txt dart_analyze.sarif $(Build.Repository.LocalPath) --repo-uri $(Build.Repository.Uri) --branch $(Build.SourceBranchName) --revision-id $(Build.SourceVersion)
displayName: "Dart analyze to SARIF"

- script: |
curl -sSL https://deepsource.io/cli | sh
./bin/deepsource report --analyzer dart-analyze --analyzer-type community --value-file ./dart_analyze.sarif
displayName: "Report to DeepSource"
env:
DEEPSOURCE_DSN: $(DEEPSOURCE_DSN)
Loading