Skip to content

Merge pull request #197 from lacework/bump-sca-v0.1.13 #654

Merge pull request #197 from lacework/bump-sca-v0.1.13

Merge pull request #197 from lacework/bump-sca-v0.1.13 #654

name: Integration test
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
LW_ACCOUNT_NAME: ${{ secrets.LW_ACCOUNT_CAT }}
LW_API_KEY: ${{ secrets.LW_API_KEY_CAT }}
LW_API_SECRET: ${{ secrets.LW_API_SECRET_CAT }}
DEBUG: 'true'
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-12
- ubuntu-22.04
runs-on: ${{ matrix.os }}
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
mv ../action/sample-repo/* .
- name: Run action
id: run-action
uses: ./../action
with:
target: push
sources: ${{ github.workspace }}
debug: true
- 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@v3
with:
name: results-push
path: artifact
- name: Check results
working-directory: artifact
run: |
export SCA_RESULTS=`jq '.runs | map (.results | length) | add' sca.sarif`
expectedScaResults=5
echo "Got $SCA_RESULTS from SCA"
if [ "$SCA_RESULTS" != "$expectedScaResults" ]; then
echo "::error::Expected to have $expectedScaResults SCA results!"
exit 1
fi