[WIP] Horusec for SCA and Potential SAST #57
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
name: Flutter/Dart Test Suite | |
on: | |
pull_request: {} | |
jobs: | |
analyze_and_test: | |
# Skip any PR created by dependabot to avoid permission issues: | |
if: (github.actor != 'dependabot[bot]') | |
permissions: | |
# For actions/checkout to fetch code | |
contents: read | |
# For github/codeql-action/upload-sarif to upload SARIF results | |
security-events: write | |
# Only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | |
actions: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Setup Dart | |
uses: dart-lang/setup-dart@v1 | |
# https://github.com/marketplace/actions/flutter-action | |
- name: Setup Flutter | |
# SHA for v2.10.0 | |
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa | |
with: | |
flutter-version: '3.13.2' | |
channel: 'stable' | |
cache: true | |
- run: flutter pub get | |
# Unit Tests | |
- name: Run Flutter Tests | |
run: flutter test | |
# See output in console until we have access | |
# to sarif file | |
- name: Dart Analyze | |
run: dart analyze | |
# 3 Tasks below commented out until Repo is Public | |
# - name: Dart Analyze | |
# run: dart analyze > dart_analyze.txt || true | |
# - name: Dart Analyze to SARIF | |
# uses: advanced-security/dart-analyzer-sarif@main | |
# with: | |
# input: dart_analyze.txt | |
# output: dart_analyze.sarif | |
# - name: Upload SARIF | |
# uses: github/codeql-action/upload-sarif@v2 | |
# with: | |
# sarif_file: dart_analyze.sarif | |
semgrep: | |
# Skip any PR created by dependabot to avoid permission issues: | |
if: (github.actor != 'dependabot[bot]') | |
name: semgrep/ci | |
runs-on: ubuntu-latest | |
container: | |
image: returntocorp/semgrep | |
steps: | |
- uses: actions/checkout@v3 | |
- run: semgrep ci | |
env: | |
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} | |
# SCA - find existing vulnerabilities affecting your project’s dependencies. | |
# REPO NEEDS TO BE PUBLIC | |
#osv-scanner: | |
# name: OSV Scanner | |
# uses: "google/osv-scanner/.github/workflows/osv-scanner-reusable-pr.yml@main" | |
# Dart SAST | |
horusec-security: | |
name: horusec-security | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Running Horusec Security | |
run: | | |
curl -fsSL https://raw.githubusercontent.com/ZupIT/horusec/main/deployments/scripts/install.sh | bash -s latest-beta | |
horusec start -p="./" -e="true" |