From 164c71f61e3a1ace4b18e2984dfff1d850aa4404 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Wed, 6 Jan 2021 09:45:58 +0530 Subject: [PATCH 1/2] uses-latest-actions --- .github/workflows/pr-build.yml | 11 +++-------- .github/workflows/pr-test.yml | 31 +++++++++++++++++++------------ .github/workflows/publish.yml | 17 +++++++---------- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 217fad90..8eb4094f 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -23,7 +23,6 @@ jobs: uses: hypertrace/actions/checksum@main - name: Cache packages - id: cache-packages uses: actions/cache@v2 with: path: ~/.gradle @@ -39,16 +38,12 @@ jobs: password: ${{ secrets.DOCKERHUB_READ_TOKEN }} - name: Build with Gradle - run: ./gradlew build dockerBuildImages + uses: hypertrace/actions/gradle@main + with: + args: build dockerBuildImages validate-helm-charts: runs-on: ubuntu-20.04 - container: - image: hypertrace/helm-gcs-packager:0.3.1 - credentials: - username: ${{ secrets.DOCKERHUB_READ_USER }} - password: ${{ secrets.DOCKERHUB_READ_TOKEN }} - # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation steps: - name: Check out code uses: actions/checkout@v2.3.4 diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index d3d790d3..89256a62 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -29,7 +29,9 @@ jobs: gradle-packages-${{ runner.os }} - name: Unit test - run: ./gradlew jacocoTestReport + uses: hypertrace/actions/gradle@main + with: + args: jacocoTestReport - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 @@ -38,22 +40,27 @@ jobs: fail_ci_if_error: true flags: unit - - name: Integration test - run: ./gradlew jacocoIntegrationTestReport - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - name: integration test reports - fail_ci_if_error: true - flags: integration + - name: Unit test + uses: hypertrace/actions/gradle@main + with: + args: jacocoIntegrationTestReport - - name: Copy test reports - run: ./gradlew copyAllReports --output-dir=/tmp/test-reports + - name: copy test reports + uses: hypertrace/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() }} + 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/workflows/publish.yml b/.github/workflows/publish.yml index c00470e1..9ef1aa4e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,7 +20,6 @@ jobs: uses: hypertrace/actions/checksum@main - name: Cache packages - id: cache-packages uses: actions/cache@v2 with: path: ~/.gradle @@ -36,7 +35,9 @@ jobs: password: ${{ secrets.DOCKERHUB_READ_TOKEN }} - name: publish docker image - run: ./gradlew publish dockerPushImages + uses: hypertrace/actions/gradle@main + with: + args: publish dockerPushImages env: DOCKER_USERNAME: ${{ secrets.DOCKERHUB_PUBLISH_USER }} DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }} @@ -46,11 +47,6 @@ jobs: publish-helm-charts: needs: publish-artifacts runs-on: ubuntu-20.04 - container: - image: hypertrace/helm-gcs-packager:0.3.1 - credentials: - username: ${{ secrets.DOCKERHUB_READ_USER }} - password: ${{ secrets.DOCKERHUB_READ_TOKEN }} steps: # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation - name: Checkout Repository @@ -59,7 +55,8 @@ jobs: fetch-depth: 0 - name: package and release charts - env: - HELM_GCS_CREDENTIALS: ${{ secrets.HELM_GCS_CREDENTIALS }} - HELM_GCS_REPOSITORY: ${{ secrets.HELM_GCS_REPOSITORY }} uses: hypertrace/actions/helm-gcs-publish@main + with: + helm-gcs-credentials: ${{ secrets.HELM_GCS_CREDENTIALS }} + helm-gcs-repository: ${{ secrets.HELM_GCS_REPOSITORY }} + From 9b912cae71b2891aebaf47e7311e21e3faa367f4 Mon Sep 17 00:00:00 2001 From: Jayesh Bapu Ahire Date: Wed, 6 Jan 2021 09:53:50 +0530 Subject: [PATCH 2/2] cleanup --- .github/workflows/merge-publish.yml | 5 +++-- .github/workflows/pr-build.yml | 6 +++--- .github/workflows/pr-test.yml | 10 +++++----- .github/workflows/publish.yml | 6 +++--- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/merge-publish.yml b/.github/workflows/merge-publish.yml index 8ef00033..1fc51ef7 100644 --- a/.github/workflows/merge-publish.yml +++ b/.github/workflows/merge-publish.yml @@ -21,7 +21,6 @@ jobs: uses: hypertrace/actions/checksum@main - name: Cache packages - id: cache-packages uses: actions/cache@v2 with: path: ~/.gradle @@ -37,7 +36,9 @@ jobs: password: ${{ secrets.DOCKERHUB_READ_TOKEN }} - name: push docker image - run: ./gradlew dockerPushImages + uses: hypertrace/github-actions/gradle@main + with: + args: dockerPushImages env: DOCKER_USERNAME: ${{ secrets.DOCKERHUB_PUBLISH_USER }} DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }} diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 8eb4094f..b831c010 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 - name: create checksum file - uses: hypertrace/actions/checksum@main + uses: hypertrace/github-actions/checksum@main - name: Cache packages uses: actions/cache@v2 @@ -38,7 +38,7 @@ jobs: password: ${{ secrets.DOCKERHUB_READ_TOKEN }} - name: Build with Gradle - uses: hypertrace/actions/gradle@main + uses: hypertrace/github-actions/gradle@main with: args: build dockerBuildImages @@ -53,7 +53,7 @@ jobs: fetch-depth: 0 - name: validate charts - uses: hypertrace/actions/validate-charts@main + uses: hypertrace/github-actions/validate-charts@main snyk-scan: runs-on: ubuntu-20.04 diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 89256a62..4e2bb426 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -16,7 +16,7 @@ jobs: fetch-depth: 0 - name: create checksum file - uses: hypertrace/actions/checksum@main + uses: hypertrace/github-actions/checksum@main - name: Cache packages id: cache-packages @@ -29,7 +29,7 @@ jobs: gradle-packages-${{ runner.os }} - name: Unit test - uses: hypertrace/actions/gradle@main + uses: hypertrace/github-actions/gradle@main with: args: jacocoTestReport @@ -41,13 +41,13 @@ jobs: flags: unit - - name: Unit test - uses: hypertrace/actions/gradle@main + - name: Integration test + uses: hypertrace/github-actions/gradle@main with: args: jacocoIntegrationTestReport - name: copy test reports - uses: hypertrace/actions/gradle@main + uses: hypertrace/github-actions/gradle@main with: args: copyAllReports --output-dir=/tmp/test-reports diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9ef1aa4e..0c247297 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - name: create checksum file - uses: hypertrace/actions/checksum@main + uses: hypertrace/github-actions/checksum@main - name: Cache packages uses: actions/cache@v2 @@ -35,7 +35,7 @@ jobs: password: ${{ secrets.DOCKERHUB_READ_TOKEN }} - name: publish docker image - uses: hypertrace/actions/gradle@main + uses: hypertrace/github-actions/gradle@main with: args: publish dockerPushImages env: @@ -55,7 +55,7 @@ jobs: fetch-depth: 0 - name: package and release charts - uses: hypertrace/actions/helm-gcs-publish@main + uses: hypertrace/github-actions/helm-gcs-publish@main with: helm-gcs-credentials: ${{ secrets.HELM_GCS_CREDENTIALS }} helm-gcs-repository: ${{ secrets.HELM_GCS_REPOSITORY }}