forked from aws/aws-codeguru-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
118 changed files
with
5,331 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Created using https://github.com/aws-samples/aws-codeguru-reviewer-cicd-cdk-sample | ||
name: Analyze with CodeGuru Reviewer | ||
|
||
on: [push] | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
security-events: write | ||
|
||
jobs: | ||
build: | ||
name: Run CodeGuru Reviewer | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
continue-on-error: true | ||
id: iam-role | ||
with: | ||
role-to-assume: arn:aws:iam::048169001733:role/GuruGitHubCICDRole | ||
aws-region: us-west-2 | ||
|
||
- uses: actions/checkout@v2 | ||
if: steps.iam-role.outcome == 'success' | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 1.8 | ||
if: steps.iam-role.outcome == 'success' | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Build project | ||
if: steps.iam-role.outcome == 'success' | ||
run: ./gradlew clean installDist | ||
|
||
- name: CodeGuru Reviewer | ||
if: steps.iam-role.outcome == 'success' | ||
id: codeguru | ||
uses: aws-actions/[email protected] | ||
continue-on-error: false | ||
with: | ||
s3_bucket: codeguru-reviewer-build-artifacts-048169001733-us-west-2 | ||
build_path: ./build/libs | ||
|
||
- name: Upload review result | ||
if: steps.iam-role.outcome == 'success' && steps.codeguru.outcome == 'success' | ||
continue-on-error: true | ||
uses: github/codeql-action/upload-sarif@v1 | ||
with: | ||
sarif_file: codeguru-results.sarif.json |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
name: Build with different JDKs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: [ '8', '11', '16', '17' ] | ||
name: Java ${{ matrix.Java }} build | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup java | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: ${{ matrix.java }} | ||
- name: Build project | ||
run: ./gradlew clean installDist | ||
- name: Run cli | ||
run: ./build/install/aws-codeguru-cli/bin/aws-codeguru-cli | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Created using https://github.com/aws-samples/aws-codeguru-reviewer-cicd-cdk-sample | ||
name: Self-test and release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
name: Build, self-test, release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Build project | ||
run: ./gradlew clean installDist distZip | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
continue-on-error: true | ||
id: iam-role | ||
with: | ||
role-to-assume: arn:aws:iam::048169001733:role/GuruGitHubCICDRole | ||
aws-region: us-west-2 | ||
|
||
- name: Self Test | ||
if: steps.iam-role.outcome == 'success' | ||
run: | | ||
./build/install/aws-codeguru-cli/bin/aws-codeguru-cli --region us-west-2 -r . -s src/main/java -b build/libs -c HEAD^:HEAD --no-prompt | ||
- name: Get Release Version | ||
run: | | ||
echo "::set-output name=TAG_NAME::$(./gradlew properties -q | grep "version:" | awk '{print $2}')" | ||
id: version | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ steps.version.outputs.TAG_NAME }} | ||
prerelease: false | ||
draft: false | ||
body: > | ||
Version ${{ steps.version.outputs.TAG_NAME }} of the AWS CodeGuru Reviewer CLI. | ||
files: | | ||
./build/distributions/aws-codeguru-cli.zip | ||
LICENSE |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
build | ||
.gradle | ||
.vscode | ||
.guru | ||
code-guru | ||
.DS_Store | ||
.idea | ||
test-output* |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
|
||
buildscript { | ||
repositories { | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
} | ||
dependencies { | ||
classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.3" | ||
} | ||
} | ||
|
||
/* | ||
Applies core Gradle plugins, which are ones built into Gradle itself. | ||
*/ | ||
plugins { | ||
// Java for compile and unit test of Java source files. Read more at: | ||
// https://docs.gradle.org/current/userguide/java_plugin.html | ||
id 'java' | ||
|
||
// Checkstyle for style checks and reports on Java source files. Read more at: | ||
// https://docs.gradle.org/current/userguide/checkstyle_plugin.html | ||
id 'checkstyle' | ||
|
||
id 'application' | ||
} | ||
|
||
// SpotBugs for quality checks and reports of source files. Read more at: | ||
// https://spotbugs.readthedocs.io/en/stable/gradle.html | ||
apply plugin: 'com.github.spotbugs' | ||
|
||
checkstyle { | ||
sourceSets = [sourceSets.main] | ||
ignoreFailures = false | ||
} | ||
|
||
spotbugs { | ||
ignoreFailures.set(false) | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
defaultTasks('installDist') | ||
|
||
version = '0.0.1' | ||
jar.archiveName = "${jar.baseName}.${jar.extension}" | ||
distZip.archiveName = "${jar.baseName}.zip" | ||
|
||
application { | ||
mainClass = 'com.amazonaws.gurureviewercli.Main' | ||
} | ||
|
||
dependencies { | ||
implementation 'software.amazon.awssdk:s3:2.17.113' | ||
implementation 'software.amazon.awssdk:sts:2.17.113' | ||
implementation 'software.amazon.awssdk:codegurureviewer:2.17.113' | ||
implementation 'software.amazon.awssdk:sdk-core:2.17.113' | ||
|
||
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0' | ||
implementation 'com.fasterxml.jackson.core:jackson-core:2.13.0' | ||
|
||
implementation 'com.beust:jcommander:1.81' | ||
|
||
implementation 'org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r' | ||
|
||
implementation 'org.apache.logging.log4j:log4j-core:2.17.1' | ||
implementation 'org.slf4j:slf4j-nop:2.0.0-alpha5' | ||
|
||
// For Java 9+ | ||
implementation 'javax.xml.bind:jaxb-api:2.3.1' | ||
|
||
implementation 'org.commonmark:commonmark:0.18.1' | ||
|
||
implementation 'org.beryx:text-io:3.4.1' | ||
|
||
implementation 'com.google.code.findbugs:jsr305:3.0.2' | ||
|
||
compileOnly 'org.projectlombok:lombok:1.18.22' | ||
annotationProcessor 'org.projectlombok:lombok:1.18.22' | ||
|
||
testCompileOnly 'org.projectlombok:lombok:1.18.22' | ||
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22' | ||
|
||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' | ||
testImplementation 'org.mockito:mockito-junit-jupiter:4.2.0' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.