@@ -43,21 +43,28 @@ jobs:
43
43
- name : Run Code Guru
44
44
if : steps.iam-role.outcome == 'success'
45
45
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"
47
47
48
- - name : Print Summary of Findings Linux
48
+ - name : Upload findings artifact
49
49
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
50
57
run : |
51
58
echo "detector,filePath,lineNumber" > summary-of-results.csv
52
59
jq -r '.runs[0].results[] | {ruleId: .ruleId, firstFile: .locations[0].physicalLocation.artifactLocation.uri, firstLine: .locations[0].physicalLocation.region.startLine} | join(",")' \
53
60
code-guru/recommendations.sarif.json | sort >> summary-of-results.csv
54
61
cat summary-of-results.csv
55
62
56
- - name : Validate Findings Linux
63
+ - name : Validate Findings ${{ matrix.os }}
57
64
if : steps.iam-role.outcome == 'success'
58
65
shell : bash
59
66
env :
60
- EXPECTED : 112
67
+ EXPECTED : 98
61
68
run : |
62
69
[[ $(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; }
63
70
78
85
matrix :
79
86
os : [ubuntu-latest, windows-latest]
80
87
name : Self Test Java on ${{ matrix.os }}
81
- steps :
88
+ steps :
82
89
- uses : actions/checkout@v2
83
90
- name : Set up JDK 1.8
84
91
uses : actions/setup-java@v1
@@ -115,15 +122,22 @@ jobs:
115
122
run : |
116
123
./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
117
124
118
- - name : Print Summary of Findings Linux
125
+ - name : Upload findings artifact
119
126
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
120
134
run : |
121
135
echo "detector,filePath,lineNumber" > summary-of-results.csv
122
136
jq -r '.runs[0].results[] | {ruleId: .ruleId, firstFile: .locations[0].physicalLocation.artifactLocation.uri, firstLine: .locations[0].physicalLocation.region.startLine} | join(",")' \
123
137
code-guru/recommendations.sarif.json | sort >> summary-of-results.csv
124
138
cat summary-of-results.csv
125
139
126
- - name : Validate Findings Linux
140
+ - name : Validate Findings ${{ matrix.os }}
127
141
if : steps.iam-role.outcome == 'success'
128
142
shell : bash
129
143
env :
@@ -158,7 +172,7 @@ jobs:
158
172
uses : actions/download-artifact@v1
159
173
with :
160
174
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
162
176
id : set_outputs
163
177
run : |
164
178
echo "::set-output name=status_ubuntu-latest::$(<pass_status_ubuntu-latest/status_ubuntu-latest.txt)"
0 commit comments