|
| 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 | + |
| 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 | + |
| 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 | + |
| 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