1
0
mirror of https://github.com/aquasecurity/kube-bench.git synced 2024-11-22 16:18:07 +00:00

Build workflow split (#1025)

* Separate yaml lint from build

* Separate e2e tests, unit tests and snapshot release

* Update build.yml

Co-authored-by: Yoav Rotem <yoavrotems97@gmail.com>
This commit is contained in:
Matthieu MOREL 2021-10-28 11:44:20 +02:00 committed by GitHub
parent 765b2d119d
commit dd68e85121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,8 +19,8 @@ env:
KIND_IMAGE: "kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6" KIND_IMAGE: "kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6"
jobs: jobs:
build: lint:
name: Build name: Lint
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- name: Setup Go - name: Setup Go
@ -31,12 +31,32 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: yaml-lint - name: yaml-lint
uses: ibiqlik/action-yamllint@v3 uses: ibiqlik/action-yamllint@v3
unit:
name: Unit tests
runs-on: ubuntu-18.04
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Checkout code
uses: actions/checkout@v2
- name: Run unit tests - name: Run unit tests
run: make tests run: make tests
- name: Upload code coverage - name: Upload code coverage
uses: codecov/codecov-action@v2 uses: codecov/codecov-action@v2
with: with:
file: ./coverage.txt file: ./coverage.txt
e2e:
name: E2e tests
runs-on: ubuntu-18.04
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Kubernetes cluster (KIND) - name: Setup Kubernetes cluster (KIND)
uses: engineerd/setup-kind@v0.5.0 uses: engineerd/setup-kind@v0.5.0
with: with:
@ -56,6 +76,17 @@ jobs:
first_file_path: ./test.data first_file_path: ./test.data
second_file_path: integration/testdata/Expected_output.data second_file_path: integration/testdata/Expected_output.data
expected_result: PASSED expected_result: PASSED
release:
name: Release snapshot
runs-on: ubuntu-18.04
needs: [e2e, unit]
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Checkout code
uses: actions/checkout@v2
- name: Dry-run release snapshot - name: Dry-run release snapshot
uses: goreleaser/goreleaser-action@v2 uses: goreleaser/goreleaser-action@v2
with: with: