Skip to content

Commit 3af3842

Browse files
committed
Add Finding Post Processing To CI
Signed-off-by: Yannik Fuhrmeister <yannik.fuhrmeister@iteratec.com>
1 parent 97f2c5d commit 3af3842

1 file changed

Lines changed: 105 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,111 @@ jobs:
384384
working-directory: ./scanners/${{ matrix.unit }}/
385385
run: make integration-tests
386386

387+
# ---- Makefiles Hooks ----
388+
389+
makefile-hooks:
390+
name: "Make Hooks"
391+
needs:
392+
- sdk
393+
- operator
394+
runs-on: ubuntu-latest
395+
strategy:
396+
matrix:
397+
unit: ["finding-post-processing"]
398+
steps:
399+
- name: Checkout
400+
uses: actions/checkout@v2
401+
402+
- uses: actions/setup-node@v2
403+
name: Setup Node
404+
with:
405+
node-version: ${{ env. NODE_VERSION }}
406+
407+
- name: Update NPM
408+
run: |
409+
npm i -g npm@${{ env.NPM_VERSION }}
410+
npm i -g jest
411+
412+
- name: Install Dependencies
413+
working-directory: ./hooks/${{ matrix.unit }}/
414+
run: make install-deps
415+
416+
- name: Unit Tests
417+
working-directory: ./hooks/${{ matrix.unit }}/
418+
run: make unit-tests
419+
420+
- name: Set baseImageTag To commit Hash
421+
run: |
422+
echo "baseImageTag=sha-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
423+
424+
- name: Docker Meta
425+
id: docker_meta
426+
uses: crazy-max/ghaction-docker-meta@v1
427+
with:
428+
images: ${{ env.DOCKER_NAMESPACE }}/hook-${{ matrix.unit }}
429+
tag-sha: true
430+
tag-semver: |
431+
{{ version }}
432+
433+
- name: Set up Docker Buildx
434+
uses: docker/setup-buildx-action@v1
435+
436+
- name: Login to DockerHub
437+
uses: docker/login-action@v1
438+
with:
439+
username: ${{ secrets.DOCKER_USERNAME }}
440+
password: ${{ secrets.DOCKER_TOKEN }}
441+
442+
- name: Build
443+
uses: docker/build-push-action@v2
444+
with:
445+
context: ./hooks/${{ matrix.unit }}/hook/
446+
file: ./hooks/${{ matrix.unit }}/hook/Dockerfile
447+
load: true
448+
build-args: |
449+
namespace=${{ env.DOCKER_NAMESPACE }}
450+
baseImageTag=${{ env.baseImageTag }}
451+
platforms: linux/amd64
452+
push: ${{ github.event_name == 'release' }}
453+
tags: ${{ steps.docker_meta.outputs.tags }}
454+
labels: ${{ steps.docker_meta.outputs.labels }}
455+
456+
- name: Export Docker Images
457+
working-directory: ./hooks/${{ matrix.unit }}/
458+
run: make docker-export
459+
460+
- name: "Start kind cluster"
461+
run: |
462+
kind version
463+
kind create cluster --image kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6 --wait 3m
464+
465+
- name: "Inspect kind cluster"
466+
run: |
467+
kubectl config current-context
468+
kubectl get node
469+
470+
- name: Kind Import Images
471+
working-directory: ./hooks/${{ matrix.unit }}/
472+
run: make kind-import
473+
474+
- name: Install Operator
475+
working-directory: ./operator
476+
run: |
477+
make helm-deploy
478+
479+
- name: Deploy ${{ matrix.unit }}
480+
working-directory: ./hooks/${{ matrix.unit }}/
481+
run: make deploy
482+
483+
- name: Deploy Test Dependencies
484+
working-directory: ./hooks/${{ matrix.unit }}/
485+
run: make deploy-test-deps
486+
487+
- name: Start Integration Tests
488+
working-directory: ./hooks/${{ matrix.unit }}/
489+
run: make integration-tests
490+
491+
387492
# ---- Build Stage | Matrix Hooks ----
388493

389494
hooks:

0 commit comments

Comments
 (0)