-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (69 loc) · 2 KB
/
integration-test.yml
File metadata and controls
72 lines (69 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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