@@ -43,21 +43,28 @@ jobs:
4343 - name : Run Code Guru
4444 if : steps.iam-role.outcome == 'success'
4545 run : |
46- ./build/install/aws-codeguru-cli/bin/aws-codeguru-cli --region us-west-2 -r python-code --no-prompt -c "c5f9c93d5605bfe3a4de02896a26b7b91eb7c007 :a574f23f6ea3fe607a6d33cc6c8fe28d81ab37a2"
46+ ./build/install/aws-codeguru-cli/bin/aws-codeguru-cli --region us-west-2 -r python-code --no-prompt -c "5a0c9579b6c9b0ea7a5f5c1b9328bb7100c7a16e :a574f23f6ea3fe607a6d33cc6c8fe28d81ab37a2"
4747
48- - name : Print Summary of Findings Linux
48+ - name : Upload findings artifact
4949 if : steps.iam-role.outcome == 'success'
50+ uses : actions/upload-artifact@v1
51+ with :
52+ name : recommendations_python_${{ matrix.os }}
53+ path : code-guru/
54+
55+ - name : Print Summary of Findings on ${{ matrix.os }}
56+ if : steps.iam-role.outcome == 'success' && matrix.os != 'windows-latest' # cat and jq don't work the same way on windows
5057 run : |
5158 echo "detector,filePath,lineNumber" > summary-of-results.csv
5259 jq -r '.runs[0].results[] | {ruleId: .ruleId, firstFile: .locations[0].physicalLocation.artifactLocation.uri, firstLine: .locations[0].physicalLocation.region.startLine} | join(",")' \
5360 code-guru/recommendations.sarif.json | sort >> summary-of-results.csv
5461 cat summary-of-results.csv
5562
56- - name : Validate Findings Linux
63+ - name : Validate Findings ${{ matrix.os }}
5764 if : steps.iam-role.outcome == 'success'
5865 shell : bash
5966 env :
60- EXPECTED : 112
67+ EXPECTED : 98
6168 run : |
6269 [[ $(jq -r '.runs[0].results[].ruleId' code-guru/recommendations.sarif.json | wc -l) -eq $EXPECTED ]] || { echo "Expected $EXPECTED recommendations but got $(jq -r '.runs[0].results[].ruleId' code-guru/recommendations.sarif.json | wc -l)"; exit 1; }
6370
7885 matrix :
7986 os : [ubuntu-latest, windows-latest]
8087 name : Self Test Java on ${{ matrix.os }}
81- steps :
88+ steps :
8289 - uses : actions/checkout@v2
8390 - name : Set up JDK 1.8
8491 uses : actions/setup-java@v1
@@ -115,15 +122,22 @@ jobs:
115122 run : |
116123 ./build/install/aws-codeguru-cli/bin/aws-codeguru-cli --region us-west-2 -r amazon-codeguru-samples -s amazon-codeguru-samples/src/main/java -b amazon-codeguru-samples/build/libs --no-prompt
117124
118- - name : Print Summary of Findings Linux
125+ - name : Upload findings artifact
119126 if : steps.iam-role.outcome == 'success'
127+ uses : actions/upload-artifact@v1
128+ with :
129+ name : recommendations_java_${{ matrix.os }}
130+ path : code-guru/
131+
132+ - name : Print Summary of Findings on ${{ matrix.os }}
133+ if : steps.iam-role.outcome == 'success' && matrix.os != 'windows-latest' # cat and jq don't work the same way on windows
120134 run : |
121135 echo "detector,filePath,lineNumber" > summary-of-results.csv
122136 jq -r '.runs[0].results[] | {ruleId: .ruleId, firstFile: .locations[0].physicalLocation.artifactLocation.uri, firstLine: .locations[0].physicalLocation.region.startLine} | join(",")' \
123137 code-guru/recommendations.sarif.json | sort >> summary-of-results.csv
124138 cat summary-of-results.csv
125139
126- - name : Validate Findings Linux
140+ - name : Validate Findings ${{ matrix.os }}
127141 if : steps.iam-role.outcome == 'success'
128142 shell : bash
129143 env :
@@ -158,7 +172,7 @@ jobs:
158172 uses : actions/download-artifact@v1
159173 with :
160174 name : pass_status_windows-latest
161- - name : Set the statuses of the windows and linux job as output parameters
175+ - name : Set the statuses of the windows and ${{ matrix.os }} job as output parameters
162176 id : set_outputs
163177 run : |
164178 echo "::set-output name=status_ubuntu-latest::$(<pass_status_ubuntu-latest/status_ubuntu-latest.txt)"
0 commit comments