Add IAC component installation and help command #1321
This file contains hidden or 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: Integration test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: "0 7 * * *" | |
| workflow_dispatch: | |
| env: | |
| LW_ACCOUNT: ${{ secrets.LW_ACCOUNT_CAT }} | |
| LW_API_KEY: ${{ secrets.LW_API_KEY_CAT }} | |
| LW_API_SECRET: ${{ secrets.LW_API_SECRET_CAT }} | |
| DEBUG: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Java | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: "temurin" | |
| java-version: "17" | |
| - name: Move action | |
| run: | | |
| mkdir ../action | |
| mv * ../action | |
| rsync --archive ../action/sample-repo/ . | |
| - name: Compile test project | |
| run: | | |
| mvn --quiet clean compile | |
| dotnet build --verbosity quiet . | |
| - name: Run action | |
| id: run-action | |
| uses: ./../action | |
| with: | |
| target: push | |
| sources: ${{ github.workspace }} | |
| code-scanning-path: scanning-report.sarif | |
| - name: Check run succeeded | |
| env: | |
| RUN_OUTPUT: ${{ steps.run-action.outputs.push-completed }} | |
| run: | | |
| if [ "$RUN_OUTPUT" == "true" ]; then | |
| echo "Test run succeeded!" | |
| else | |
| echo "::error Test run failed!" | |
| exit 1 | |
| fi | |
| - name: Download results | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: results-push | |
| path: artifact | |
| - name: Check results | |
| working-directory: artifact | |
| run: | | |
| if [ -f scanning-report.sarif ]; then | |
| export expectedScaResults=9 | |
| export SCA_RESULTS=`jq '.runs | map (.results | length) | add' scanning-report.sarif` | |
| if [ "$SCA_RESULTS" -eq $expectedScaResults ]; then | |
| echo "Found expected number of SCA results: $SCA_RESULTS" | |
| else | |
| echo "::error::Expected to have $expectedScaResults SCA results!" | |
| exit 1 | |
| fi | |
| fi |