-
Notifications
You must be signed in to change notification settings - Fork 8
ci: migrating to GitHub actions #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1315397
cec547f
e51871b
250c881
1988f24
9fc258a
ea1bf41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: merge-publish | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| merge-publish: | ||
| 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: create checksum file | ||
| uses: hypertrace/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: Login to Docker Hub | ||
| uses: docker/login-action@v1 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_READ_USER }} | ||
| password: ${{ secrets.DOCKERHUB_READ_TOKEN }} | ||
|
|
||
| - name: push docker image | ||
| uses: hypertrace/actions/gradle@main | ||
| with: | ||
| args: dockerPushImages | ||
| env: | ||
| DOCKER_USERNAME: ${{ secrets.DOCKERHUB_PUBLISH_USER }} | ||
| DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| name: build and validate | ||
| 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: | ||
| ref: ${{github.event.pull_request.head.ref}} | ||
| repository: ${{github.event.pull_request.head.repo.full_name}} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: create checksum file | ||
| uses: hypertrace/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: Login to Docker Hub | ||
| uses: docker/login-action@v1 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_READ_USER }} | ||
| password: ${{ secrets.DOCKERHUB_READ_TOKEN }} | ||
|
|
||
| - name: Build with Gradle | ||
| uses: hypertrace/actions/gradle@main | ||
| with: | ||
| args: build dockerBuildImages | ||
|
|
||
| validate-helm-charts: | ||
| runs-on: ubuntu-20.04 | ||
| steps: | ||
| - 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: validate charts | ||
| uses: hypertrace/actions/validate-charts@main | ||
|
|
||
| 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$' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also may be worth moving this into an action at some point
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think, we can't move this step to action as it's already using other action. let me try this one.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the setup itself would have to stay out (still crazy to me that GH doesn't support this yet, suspect it must be coming soon), but the test could be its own action right? or we could make the test run in a containerized action which means setup isn't needed
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for this, I would wait as they said they will bring support for uses and if in near future. We would like to abstract this at that time anyways. :) Let me know if that will be fine. We can surely move test but that's a single command so I won't bother a lot about it.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Up to you. The problem I'm trying to avoid is that the argument set of this command has evolved over time, and now is mismatched in different repos depending on when their ci was set up. Capturing even the single line in an action avoids that (similar to our checksum action), but perhaps it's stable enough now that it's less of a concern and not worth the effort. Also, I think using a docker-type action allows us to do everything together and do that abstraction now, but again may be more trouble than it's worth - not sure how complex those actions types are to set up. |
||
| env: | ||
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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/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: Unit test | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just checked, it's not there.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, nope :) |
||
| uses: hypertrace/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/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 | ||
Uh oh!
There was an error while loading. Please reload this page.