Skip to content

Commit d251177

Browse files
authored
ci: migrating to GitHub actions (#40)
* migrating to GHA and removes CCI * removes CCI * addressed Aaron's comments
1 parent ce6a575 commit d251177

File tree

8 files changed

+230
-167
lines changed

8 files changed

+230
-167
lines changed

.circleci/config.yml

Lines changed: 0 additions & 165 deletions
This file was deleted.

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22

33
# global
44
* @hypertrace/graphql
5+
6+
# GH action
7+
.github/ @aaron-steinfeld @jbahire @kotharironak @buchi-busireddy

.github/workflows/merge-publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: merge-publish
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
merge-publish:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
13+
- name: Check out code
14+
uses: actions/[email protected]
15+
with:
16+
fetch-depth: 0
17+
18+
- name: create checksum file
19+
uses: hypertrace/actions/checksum@main
20+
21+
- name: Cache packages
22+
uses: actions/cache@v2
23+
with:
24+
path: ~/.gradle
25+
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
26+
restore-keys: |
27+
gradle-packages-${{ runner.os }}-${{ github.job }}
28+
gradle-packages-${{ runner.os }}
29+
30+
- name: Login to Docker Hub
31+
uses: docker/login-action@v1
32+
with:
33+
username: ${{ secrets.DOCKERHUB_READ_USER }}
34+
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}
35+
36+
- name: push docker image
37+
uses: hypertrace/github-actions/gradle@main
38+
with:
39+
args: dockerPushImages
40+
env:
41+
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_PUBLISH_USER }}
42+
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }}

.github/workflows/pr-build.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: build and validate
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request_target:
7+
branches:
8+
- main
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-20.04
13+
steps:
14+
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
15+
- name: Check out code
16+
uses: actions/[email protected]
17+
with:
18+
ref: ${{github.event.pull_request.head.ref}}
19+
repository: ${{github.event.pull_request.head.repo.full_name}}
20+
fetch-depth: 0
21+
22+
- name: create checksum file
23+
uses: hypertrace/github-actions/checksum@main
24+
25+
- name: Cache packages
26+
uses: actions/cache@v2
27+
with:
28+
path: ~/.gradle
29+
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
30+
restore-keys: |
31+
gradle-packages-${{ runner.os }}-${{ github.job }}
32+
gradle-packages-${{ runner.os }}
33+
34+
- name: Login to Docker Hub
35+
uses: docker/login-action@v1
36+
with:
37+
username: ${{ secrets.DOCKERHUB_READ_USER }}
38+
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}
39+
40+
- name: Build with Gradle
41+
uses: hypertrace/github-actions/gradle@main
42+
with:
43+
args: build dockerBuildImages
44+
45+
validate-helm-charts:
46+
runs-on: ubuntu-20.04
47+
steps:
48+
- name: Check out code
49+
uses: actions/[email protected]
50+
with:
51+
ref: ${{github.event.pull_request.head.ref}}
52+
repository: ${{github.event.pull_request.head.repo.full_name}}
53+
fetch-depth: 0
54+
55+
- name: validate charts
56+
uses: hypertrace/github-actions/validate-charts@main
57+
58+
snyk-scan:
59+
runs-on: ubuntu-20.04
60+
steps:
61+
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
62+
- name: Check out code
63+
uses: actions/[email protected]
64+
with:
65+
ref: ${{github.event.pull_request.head.ref}}
66+
repository: ${{github.event.pull_request.head.repo.full_name}}
67+
fetch-depth: 0
68+
- name: Setup snyk
69+
uses: snyk/actions/[email protected]
70+
- name: Snyk test
71+
run: snyk test --all-sub-projects --org=hypertrace --severity-threshold=low --policy-path=.snyk --configuration-matching='^runtimeClasspath$'
72+
env:
73+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

.github/workflows/pr-test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
13+
- name: Check out code
14+
uses: actions/[email protected]
15+
with:
16+
fetch-depth: 0
17+
18+
- name: create checksum file
19+
uses: hypertrace/github-actions/checksum@main
20+
21+
- name: Cache packages
22+
id: cache-packages
23+
uses: actions/cache@v2
24+
with:
25+
path: ~/.gradle
26+
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
27+
restore-keys: |
28+
gradle-packages-${{ runner.os }}-${{ github.job }}
29+
gradle-packages-${{ runner.os }}
30+
31+
- name: Unit test
32+
uses: hypertrace/github-actions/gradle@main
33+
with:
34+
args: jacocoTestReport
35+
36+
- name: Upload coverage to Codecov
37+
uses: codecov/codecov-action@v1
38+
with:
39+
name: unit test reports
40+
fail_ci_if_error: true
41+
flags: unit
42+
43+
- name: Publish Unit Test Results
44+
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1.6
45+
if: always()
46+
with:
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
files: ./**/build/test-results/**/*.xml

0 commit comments

Comments
 (0)