Skip to content

Commit 61ed070

Browse files
authored
ci: migrating to GitHub actions (#54)
* migrating to GHA * removes CCI * pulls submodule as well * addressed Aaron's comments
1 parent 4740c3d commit 61ed070

File tree

9 files changed

+252
-211
lines changed

9 files changed

+252
-211
lines changed

.circleci/config.yml

Lines changed: 0 additions & 208 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: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
submodules: recursive
18+
19+
- name: create checksum file
20+
uses: hypertrace/actions/checksum@main
21+
22+
- name: 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: Login to Docker Hub
32+
uses: docker/login-action@v1
33+
with:
34+
username: ${{ secrets.DOCKERHUB_READ_USER }}
35+
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}
36+
37+
- name: push docker image
38+
uses: hypertrace/github-actions/gradle@main
39+
with:
40+
args: dockerPushImages
41+
env:
42+
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_PUBLISH_USER }}
43+
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }}

.github/workflows/pr-build.yml

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

0 commit comments

Comments
 (0)