From ddea2498bb96680a223e210a748824ae19bb9353 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 7 Jan 2021 13:01:06 +0530 Subject: [PATCH 01/12] adds-gha --- .DS_Store | Bin 0 -> 8196 bytes .github/pr-build.yml | 26 +++++++++++++++++++ .github/pr-test.yml | 60 +++++++++++++++++++++++++++++++++++++++++++ .github/publish.yml | 39 ++++++++++++++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 .DS_Store create mode 100644 .github/pr-build.yml create mode 100644 .github/pr-test.yml create mode 100644 .github/publish.yml diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..3206d793549ad8ffdd0feab2ace78c363bd86fb9 GIT binary patch literal 8196 zcmeHMyG|QH6ukphFruMEfnq~N0}_9*Ag4)%ghU-bz#zP=WgAjOT1BEw1L;!o5u`#w zLZZkQq>7Y4LjhlaICo~eo?*S>Wke$GNHb?W_c3SA*t@!GB2tUnwRxfmA}XRYj*nsJ z)7Z{E(}wKK6i^|as7ei5#kkR^XS`)X6c7bO0Z~8{5C#4P1@O$~R?K@_>fGF@P z72x|rfX*0NObqH<2L@dN01KGb4cDjxbWC6|w3rywp~z{f2W3N*Eise{hdp3-U}!Nh zXu?UEa8h<-YKPY8*99z}QNEuP82+ zDvh`TYw`2ppM`_n+Z_>*IWR7JS)roeq9xjLEDAnUuo+$1y$@lX3n497osL-M^)%Y!o&*uCb zY&^Tm<-@O(%PpTClRO`fhq?K_!&z)m2XA@|pAJ69cBYN_S!%=9q8-dvaWzY8nsvYcp$=p+Fu$eu5X$eB$u$wsHGL&4?YDG|xwd+7RR0YEHJ_K|NH#+|IbZB@{0nZzzZs%3Z>=JA_&;pIzxqP?Ew8FIyd%9 u4C)XJx*P}UavYfcVTkJht{f9uOblWM?FC*06rcLcmgm1dIvM_B1#SQg=X2Bm literal 0 HcmV?d00001 diff --git a/.github/pr-build.yml b/.github/pr-build.yml new file mode 100644 index 0000000..97a7f36 --- /dev/null +++ b/.github/pr-build.yml @@ -0,0 +1,26 @@ +name: snyk scan +on: + push: + branches: + - main + pull_request_target: + branches: + - main + +jobs: + snyk-scan: + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + fetch-depth: 0 + - name: Setup snyk + uses: snyk/actions/setup@0.3.0 + - name: Snyk test + run: snyk test --all-sub-projects --org=hypertrace --severity-threshold=low --policy-path=.snyk --configuration-matching='^runtimeClasspath$' + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} diff --git a/.github/pr-test.yml b/.github/pr-test.yml new file mode 100644 index 0000000..cb8501e --- /dev/null +++ b/.github/pr-test.yml @@ -0,0 +1,60 @@ +name: test +on: + push: + branches: + - main + pull_request: + +jobs: + test: + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + + - name: create checksum file + uses: hypertrace/github-actions/checksum@main + + - name: Cache packages + id: cache-packages + uses: actions/cache@v2 + with: + path: ~/.gradle + key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }} + restore-keys: | + gradle-packages-${{ runner.os }}-${{ github.job }} + gradle-packages-${{ runner.os }} + + - name: Unit test + uses: hypertrace/github-actions/gradle@main + with: + args: jacocoTestReport + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + name: unit test reports + fail_ci_if_error: true + flags: unit + + - name: copy test reports + uses: hypertrace/github-actions/gradle@main + with: + args: copyAllReports --output-dir=/tmp/test-reports + + - name: Archive test reports + uses: actions/upload-artifact@v1 + with: + name: test-reports + path: /tmp/test-reports + if: always() + + - name: Publish Unit Test Results + uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1.6 + if: always() + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + files: ./**/build/test-results/**/*.xml diff --git a/.github/publish.yml b/.github/publish.yml new file mode 100644 index 0000000..336a604 --- /dev/null +++ b/.github/publish.yml @@ -0,0 +1,39 @@ +name: Publish artifacts +on: +# Will only run when release is published. + release: + types: + - created + workflow_dispatch: + +jobs: + publish-artifacts: + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + + - name: create checksum file + uses: hypertrace/github-actions/checksum@main + + - name: Cache packages + uses: actions/cache@v2 + with: + path: ~/.gradle + key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }} + restore-keys: | + gradle-packages-${{ runner.os }}-${{ github.job }} + gradle-packages-${{ runner.os }} + + - name: publish java artifacts + uses: hypertrace/github-actions/gradle@main + with: + args: publish + env: + ORG_GRADLE_PROJECT_publishUser: ${{ secrets.BINTRAY_USER }} + ORG_GRADLE_PROJECT_publishApiKey: ${{ secrets.BINTRAY_API_KEY }} + + From fc843e8b9a11f6032d54f52e6915b464301cbc99 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 7 Jan 2021 13:01:23 +0530 Subject: [PATCH 02/12] removes cci --- .circleci/config.yml | 107 ------------------------------------------- 1 file changed, 107 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 6cc44fd..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,107 +0,0 @@ -version: 2.1 - -orbs: - codecov: codecov/codecov@1 - snyk: snyk/snyk@0.0.10 - -executors: - java: - docker: - - image: cimg/openjdk:11.0 - -commands: - gradle: - description: 'Run the provided gradle command' - parameters: - args: - type: string - when: - default: "on_success" - type: enum - enum: ["on_fail", "on_success", "always"] - steps: - - run: - name: << parameters.args >> - command: ./gradlew << parameters.args >> --info --max-workers=2 -Dorg.gradle.jvmargs=-Xmx2g -Dorg.gradle.console=plain --continue - when: << parameters.when >> - setup_build_environment: - description: 'Generates cache key from a hash of all gradle files' - steps: - - checkout - - run: - name: Generate cache key - command: find . -type f -name "*.gradle*" -o -name "gradle-wrapper*" -exec shasum {} + | sort > /tmp/checksum.txt && cat /tmp/checksum.txt - - restore_cache: - keys: - - v1-dependencies-{{ checksum "/tmp/checksum.txt" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - populate_and_save_cache: - description: 'Downloads all gradle dependencies and uploads cache for later use' - steps: - - gradle: - args: downloadDependencies - - save_cache: - paths: - - ~/.gradle - key: v1-dependencies-{{ checksum "/tmp/checksum.txt" }} - -jobs: - build: - executor: java - steps: - - setup_build_environment - - setup_remote_docker - - populate_and_save_cache - - gradle: - args: build - - gradle: - args: jacocoTestReport - - gradle: - args: copyAllReports --output-dir=/tmp/test-reports - when: always - - codecov/upload - - store_test_results: - path: /tmp/test-reports - - store_artifacts: - path: /tmp/test-reports - destination: reports - - publish: - executor: java - steps: - - setup_build_environment - - setup_remote_docker - - gradle: - args: :tag -Prelease - - add_ssh_keys: - fingerprints: - - '3d:92:e9:3f:26:4c:0f:2b:34:0c:be:ba:38:71:13:89' - - run: git push origin $(./gradlew -q :printVersion) - - gradle: - args: publish - snyk-scan: - executor: java - environment: - GRADLE_OPTS: -Dorg.gradle.workers.max=1 # Snyk doesn't handle parallelism well - steps: - - setup_build_environment - - snyk/scan: - additional-arguments: --all-sub-projects - -workflows: - version: 2 - build-and-publish: - jobs: - - build - - snyk-scan: - context: hypertrace-vulnerability-scanning - - publish: - context: hypertrace-publishing - requires: - - build - - snyk-scan - filters: - branches: - only: - - main From f71439cb35788af7ad478feb3e5fbba60b123dbc Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 7 Jan 2021 13:07:15 +0530 Subject: [PATCH 03/12] cleanup --- .github/CODEOWNERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9b4f6c9..da3e929 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,3 +2,6 @@ # global * @buchi-busireddy @tim-mwangi @surajpuvvada @avinashkolluru + +# GH action +.github/ @aaron-steinfeld @jbahire @kotharironak @buchi-busireddy \ No newline at end of file From 28c5512e774e5df106ad5f9958a916bdb478e63e Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 7 Jan 2021 13:18:31 +0530 Subject: [PATCH 04/12] directory --- .github/{ => workflows}/pr-build.yml | 0 .github/{ => workflows}/pr-test.yml | 0 .github/{ => workflows}/publish.yml | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/pr-build.yml (100%) rename .github/{ => workflows}/pr-test.yml (100%) rename .github/{ => workflows}/publish.yml (100%) diff --git a/.github/pr-build.yml b/.github/workflows/pr-build.yml similarity index 100% rename from .github/pr-build.yml rename to .github/workflows/pr-build.yml diff --git a/.github/pr-test.yml b/.github/workflows/pr-test.yml similarity index 100% rename from .github/pr-test.yml rename to .github/workflows/pr-test.yml diff --git a/.github/publish.yml b/.github/workflows/publish.yml similarity index 100% rename from .github/publish.yml rename to .github/workflows/publish.yml From e46451d85cf218bfd8ce94e4b79a1797dda1f1b5 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Thu, 7 Jan 2021 15:59:17 +0530 Subject: [PATCH 05/12] adds codecov file --- codecov.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..8a333e5 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,2 @@ +codecov: + max_report_age: off From 7a37170d425dc12a2ef36a0e33638e7e1dbf74c4 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Fri, 8 Jan 2021 11:49:16 +0530 Subject: [PATCH 06/12] adds build job --- .github/workflows/pr-test.yml | 27 +++++++++++++++++++ .../workflows/{pr-build.yml => snyk-scan.yml} | 0 2 files changed, 27 insertions(+) rename .github/workflows/{pr-build.yml => snyk-scan.yml} (100%) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index cb8501e..3253bce 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -58,3 +58,30 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} files: ./**/build/test-results/**/*.xml + + build: + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + + - name: create checksum file + uses: hypertrace/github-actions/checksum@main + + - name: Cache packages + id: cache-packages + uses: actions/cache@v2 + with: + path: ~/.gradle + key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }} + restore-keys: | + gradle-packages-${{ runner.os }}-${{ github.job }} + gradle-packages-${{ runner.os }} + + - name: Unit test + uses: hypertrace/github-actions/gradle@main + with: + args: build \ No newline at end of file diff --git a/.github/workflows/pr-build.yml b/.github/workflows/snyk-scan.yml similarity index 100% rename from .github/workflows/pr-build.yml rename to .github/workflows/snyk-scan.yml From 8cbcc3f78f04d3e68d04d5fa75bad9b1927dbcbe Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Fri, 8 Jan 2021 11:58:09 +0530 Subject: [PATCH 07/12] addressed ronak's comment --- .github/workflows/pr-build.yml | 54 +++++++++++++++++++++++++++++++++ .github/workflows/pr-test.yml | 27 ----------------- .github/workflows/snyk-scan.yml | 26 ---------------- 3 files changed, 54 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/pr-build.yml delete mode 100644 .github/workflows/snyk-scan.yml diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml new file mode 100644 index 0000000..80df02c --- /dev/null +++ b/.github/workflows/pr-build.yml @@ -0,0 +1,54 @@ +name: snyk scan +on: + push: + branches: + - main + pull_request_target: + branches: + - main + +jobs: + + build: + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + + - name: create checksum file + uses: hypertrace/github-actions/checksum@main + + - name: Cache packages + id: cache-packages + uses: actions/cache@v2 + with: + path: ~/.gradle + key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }} + restore-keys: | + gradle-packages-${{ runner.os }}-${{ github.job }} + gradle-packages-${{ runner.os }} + + - name: Unit test + uses: hypertrace/github-actions/gradle@main + with: + args: build + + snyk-scan: + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + fetch-depth: 0 + - name: Setup snyk + uses: snyk/actions/setup@0.3.0 + - name: Snyk test + run: snyk test --all-sub-projects --org=hypertrace --severity-threshold=low --policy-path=.snyk --configuration-matching='^runtimeClasspath$' + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 3253bce..cb8501e 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -58,30 +58,3 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} files: ./**/build/test-results/**/*.xml - - build: - runs-on: ubuntu-20.04 - steps: - # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation - - name: Check out code - uses: actions/checkout@v2.3.4 - with: - fetch-depth: 0 - - - name: create checksum file - uses: hypertrace/github-actions/checksum@main - - - name: Cache packages - id: cache-packages - uses: actions/cache@v2 - with: - path: ~/.gradle - key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }} - restore-keys: | - gradle-packages-${{ runner.os }}-${{ github.job }} - gradle-packages-${{ runner.os }} - - - name: Unit test - uses: hypertrace/github-actions/gradle@main - with: - args: build \ No newline at end of file diff --git a/.github/workflows/snyk-scan.yml b/.github/workflows/snyk-scan.yml deleted file mode 100644 index 97a7f36..0000000 --- a/.github/workflows/snyk-scan.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: snyk scan -on: - push: - branches: - - main - pull_request_target: - branches: - - main - -jobs: - snyk-scan: - runs-on: ubuntu-20.04 - steps: - # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation - - name: Check out code - uses: actions/checkout@v2.3.4 - with: - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - fetch-depth: 0 - - name: Setup snyk - uses: snyk/actions/setup@0.3.0 - - name: Snyk test - run: snyk test --all-sub-projects --org=hypertrace --severity-threshold=low --policy-path=.snyk --configuration-matching='^runtimeClasspath$' - env: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} From 79a76fa823fcdad0094e9b36baf826140764f621 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Fri, 8 Jan 2021 12:01:46 +0530 Subject: [PATCH 08/12] addressed ronak's comment --- .github/workflows/pr-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 80df02c..ca53212 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -1,4 +1,4 @@ -name: snyk scan +name: build on: push: branches: From bb791523d2b216cae0076c3deeb52f3287cfc3b4 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Fri, 8 Jan 2021 12:10:37 +0530 Subject: [PATCH 09/12] addressed ronak's comments --- .github/workflows/pr-build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index ca53212..0292393 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -1,4 +1,4 @@ -name: build +name: build & validate on: push: branches: @@ -16,6 +16,8 @@ jobs: - name: Check out code uses: actions/checkout@v2.3.4 with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} fetch-depth: 0 - name: create checksum file From 7e1fab6aedbc1997137b05fdc36217067e4bf7c9 Mon Sep 17 00:00:00 2001 From: kotharironak <53209990+kotharironak@users.noreply.github.com> Date: Fri, 8 Jan 2021 12:14:00 +0530 Subject: [PATCH 10/12] Update .github/workflows/pr-build.yml --- .github/workflows/pr-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 0292393..f374b5b 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -1,4 +1,4 @@ -name: build & validate +name: build and validate on: push: branches: From ef52ae3b8263e496bb837d82e4965e1e25e0d4d5 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Fri, 8 Jan 2021 12:14:28 +0530 Subject: [PATCH 11/12] cleanup --- .DS_Store | Bin 8196 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 3206d793549ad8ffdd0feab2ace78c363bd86fb9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHMyG|QH6ukphFruMEfnq~N0}_9*Ag4)%ghU-bz#zP=WgAjOT1BEw1L;!o5u`#w zLZZkQq>7Y4LjhlaICo~eo?*S>Wke$GNHb?W_c3SA*t@!GB2tUnwRxfmA}XRYj*nsJ z)7Z{E(}wKK6i^|as7ei5#kkR^XS`)X6c7bO0Z~8{5C#4P1@O$~R?K@_>fGF@P z72x|rfX*0NObqH<2L@dN01KGb4cDjxbWC6|w3rywp~z{f2W3N*Eise{hdp3-U}!Nh zXu?UEa8h<-YKPY8*99z}QNEuP82+ zDvh`TYw`2ppM`_n+Z_>*IWR7JS)roeq9xjLEDAnUuo+$1y$@lX3n497osL-M^)%Y!o&*uCb zY&^Tm<-@O(%PpTClRO`fhq?K_!&z)m2XA@|pAJ69cBYN_S!%=9q8-dvaWzY8nsvYcp$=p+Fu$eu5X$eB$u$wsHGL&4?YDG|xwd+7RR0YEHJ_K|NH#+|IbZB@{0nZzzZs%3Z>=JA_&;pIzxqP?Ew8FIyd%9 u4C)XJx*P}UavYfcVTkJht{f9uOblWM?FC*06rcLcmgm1dIvM_B1#SQg=X2Bm From 06a38765831078906743268cc280d1ab840b2e00 Mon Sep 17 00:00:00 2001 From: kotharironak <53209990+kotharironak@users.noreply.github.com> Date: Fri, 8 Jan 2021 12:14:44 +0530 Subject: [PATCH 12/12] Update .github/workflows/pr-build.yml --- .github/workflows/pr-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index f374b5b..caa6cb3 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -33,7 +33,7 @@ jobs: gradle-packages-${{ runner.os }}-${{ github.job }} gradle-packages-${{ runner.os }} - - name: Unit test + - name: Build with Gradle uses: hypertrace/github-actions/gradle@main with: args: build