|
| 1 | +name: CI Fuzz |
| 2 | +# Set a CI/CD variable called "CI_SENSE_API_TOKEN" with an API token |
| 3 | +# generated in CI Fuzz web interface and a variable called "CI_FUZZ_DOWNLOAD_TOKEN" |
| 4 | +# with a download token from https://downloads.code-intelligence.com. |
| 5 | +# To download the CI Fuzz maven extension or gradle plugin set the secrets |
| 6 | +# MAVEN_REGISTRY_USERNAME and MAVEN_REGISTRY_PASSWORD with the credentials |
| 7 | +# from https://downloads.code-intelligence.com. |
| 8 | + |
| 9 | +on: |
| 10 | + workflow_dispatch: |
| 11 | + push: |
| 12 | + branches: [ main ] |
| 13 | + pull_request: |
| 14 | + branches: [ main ] |
| 15 | + |
| 16 | +env: |
| 17 | + # Timeout until the pipeline is marked as 'success' |
| 18 | + # if during that time no failing findings are found. |
| 19 | + TIMEOUT: "5m" |
| 20 | + # Minimum severity for findings that causes the pipeline to fail. |
| 21 | + # Findings with lower severity are still reported but do not fail |
| 22 | + # the pipeline. |
| 23 | + # Possible values: 'LOW', 'MEDIUM', 'HIGH', 'CRITICAL' |
| 24 | + MIN_FINDINGS_SEVERITY: MEDIUM |
| 25 | + # The CI Sense URL. |
| 26 | + CI_SENSE_HTTP_URL: https://app.code-intelligence.com |
| 27 | + CI_SENSE_GRPC_URL: grpc.code-intelligence.com:443 |
| 28 | + # The CI Sense project name. |
| 29 | + PROJECT: prj-q4ovLGx5JuGl |
| 30 | + # Directory in which the repository will be cloned. |
| 31 | + CHECKOUT_DIR: checkout-dir/ |
| 32 | +jobs: |
| 33 | + fuzz_tests: |
| 34 | + runs-on: ubuntu-latest |
| 35 | + steps: |
| 36 | + - id: checkout |
| 37 | + name: Checkout Repository |
| 38 | + uses: actions/checkout@v2 |
| 39 | + with: |
| 40 | + path: ${{ env.CHECKOUT_DIR }} |
| 41 | + # Uncomment to configure access to CI Fuzz maven repository. |
| 42 | + # - uses: s4u/maven-settings-action@v2.8.0 |
| 43 | + # with: |
| 44 | + # servers: '[{"id": "code-intelligence", "username": "${{ secrets.MAVEN_REGISTRY_USERNAME }}", "password": "${{ secrets.MAVEN_REGISTRY_PASSWORD }}"}]' |
| 45 | + - id: install-cifuzz |
| 46 | + name: Install cifuzz |
| 47 | + uses: CodeIntelligenceTesting/github-actions/install-cifuzz@v6 |
| 48 | + with: |
| 49 | + download_token: ${{ secrets.CI_FUZZ_DOWNLOAD_TOKEN }} |
| 50 | + version: 'latest' |
| 51 | + - id: run-fuzz-tests |
| 52 | + name: Run Fuzz Tests |
| 53 | + uses: CodeIntelligenceTesting/github-actions/run-fuzz-tests@v6 |
| 54 | + with: |
| 55 | + ci_sense_api_token: ${{ secrets.CI_SENSE_API_TOKEN }} |
| 56 | + project_name: ${{ env.PROJECT }} |
| 57 | + repository_dir: ${{ env.CHECKOUT_DIR }} |
| 58 | + timeout: ${{ env.TIMEOUT }} |
| 59 | + min_findings_severity: ${{ env.MIN_FINDINGS_SEVERITY }} |
| 60 | + ci_sense_http_url: ${{ env.CI_SENSE_HTTP_URL }} |
| 61 | + - id: save-results |
| 62 | + name: Save Fuzz Test Results |
| 63 | + uses: CodeIntelligenceTesting/github-actions/save-results@v6 |
| 64 | + if: ${{ success() || failure() }} |
| 65 | + with: |
| 66 | + ci_sense_api_token: ${{ secrets.CI_SENSE_API_TOKEN }} |
| 67 | + ci_sense_http_url: ${{ env.CI_SENSE_HTTP_URL }} |
| 68 | + ci_sense_grpc_url: ${{ env.CI_SENSE_GRPC_URL }} |
| 69 | + project_name: ${{ env.PROJECT }} |
| 70 | + started_run: ${{ steps.run-fuzz-tests.outputs.started_run }} |
| 71 | + - id: upload-artifact |
| 72 | + uses: actions/upload-artifact@v2 |
| 73 | + if: ${{ (success() || failure()) }} |
| 74 | + with: |
| 75 | + name: ci_fuzz_results |
| 76 | + path: | |
| 77 | + findings.json |
| 78 | + coverage.json |
| 79 | + web_app_address.txt |
0 commit comments