From 7fd1396cff48ac79bf1fa130c58dec83ef47eb7c Mon Sep 17 00:00:00 2001 From: David Wertenteil Date: Mon, 4 Mar 2024 09:45:50 +0200 Subject: [PATCH] Fixed link (#1624) * fixed link Signed-off-by: David Wertenteil * Adding unit tests to PR check Signed-off-by: David Wertenteil --------- Signed-off-by: David Wertenteil --- .github/workflows/00-pr-scanner.yaml | 2 + .github/workflows/a-pr-scanner.yaml | 61 ++++++++++++++++++++++++++ .github/workflows/d-publish-image.yaml | 4 +- README.md | 2 +- 4 files changed, 66 insertions(+), 3 deletions(-) diff --git a/.github/workflows/00-pr-scanner.yaml b/.github/workflows/00-pr-scanner.yaml index f0a28c4b..3f5e30c5 100644 --- a/.github/workflows/00-pr-scanner.yaml +++ b/.github/workflows/00-pr-scanner.yaml @@ -38,6 +38,8 @@ jobs: with: RELEASE: "" CLIENT: test + CGO_ENABLED: 0 + GO111MODULE: "" secrets: inherit binary-build: diff --git a/.github/workflows/a-pr-scanner.yaml b/.github/workflows/a-pr-scanner.yaml index a79d93c5..8bcfdf12 100644 --- a/.github/workflows/a-pr-scanner.yaml +++ b/.github/workflows/a-pr-scanner.yaml @@ -15,7 +15,68 @@ on: required: false type: string default: "./..." + GO111MODULE: + required: true + type: string + CGO_ENABLED: + type: number + default: 1 jobs: + unit-tests: + if: ${{ github.actor != 'kubescape' }} + name: Create cross-platform build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + + - uses: actions/setup-go@v4 + name: Installing go + with: + go-version: ${{ inputs.GO_VERSION }} + cache: true + + - name: Test core pkg + run: ${{ env.DOCKER_CMD }} go test -v ./... + if: startsWith(github.ref, 'refs/tags') + + - name: Test httphandler pkg + run: ${{ env.DOCKER_CMD }} sh -c 'cd httphandler && go test -v ./...' + if: startsWith(github.ref, 'refs/tags') + + - uses: anchore/sbom-action/download-syft@v0.15.2 + name: Setup Syft + + - uses: goreleaser/goreleaser-action@v5 + name: Build + with: + distribution: goreleaser + version: latest + args: release --clean --snapshot + env: + RELEASE: ${{ inputs.RELEASE }} + CLIENT: ${{ inputs.CLIENT }} + CGO_ENABLED: ${{ inputs.CGO_ENABLED }} + + - name: Smoke Testing + env: + RELEASE: ${{ inputs.RELEASE }} + KUBESCAPE_SKIP_UPDATE_CHECK: "true" + run: ${{ env.DOCKER_CMD }} python3 smoke_testing/init.py ${PWD}/dist/kubescape-ubuntu-latest + + - name: golangci-lint + continue-on-error: false + uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # ratchet:golangci/golangci-lint-action@v3 + with: + version: latest + args: --timeout 10m --build-tags=static + only-new-issues: true + scanners: env: GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }} diff --git a/.github/workflows/d-publish-image.yaml b/.github/workflows/d-publish-image.yaml index d156bc50..320ebe49 100644 --- a/.github/workflows/d-publish-image.yaml +++ b/.github/workflows/d-publish-image.yaml @@ -63,9 +63,9 @@ jobs: with: path: . - name: mv kubescape amd64 binary - run: mv ${{steps.download-artifact.outputs.download-path}}/kubescape-ubuntu-latest kubescape-amd64-ubuntu-latest + run: mv ${{steps.download-artifact.outputs.download-path}}/kubescape/kubescape-ubuntu-latest kubescape-amd64-ubuntu-latest - name: mv kubescape arm64 binary - run: mv ${{steps.download-artifact.outputs.download-path}}/kubescape-arm64-ubuntu-latest kubescape-arm64-ubuntu-latest + run: mv ${{steps.download-artifact.outputs.download-path}}/kubescape/kubescape-arm64-ubuntu-latest kubescape-arm64-ubuntu-latest - name: chmod +x run: chmod +x -v kubescape-a* - name: Build and push images diff --git a/README.md b/README.md index 2d396ea8..183142ff 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ _Did you know you can use Kubescape in all these places?_ ## Kubescape-operator Helm-Chart -Besides the CLI, the Kubescape operator can also be installed via a Helm chart. Installing the Helm chart is an excellent way to begin using Kubescape, as it provides extensive features such as continuous scanning, image vulnerability scanning, runtime analysis, network policy generation, and more. You can find the Helm chart in the [Kubescape-operator documentation](https://kubescape.io/docs/install-helm-chart/). +Besides the CLI, the Kubescape operator can also be installed via a Helm chart. Installing the Helm chart is an excellent way to begin using Kubescape, as it provides extensive features such as continuous scanning, image vulnerability scanning, runtime analysis, network policy generation, and more. You can find the Helm chart in the [Kubescape-operator documentation](https://kubescape.io/docs/install-operator/). ## Kubescape GitHub Action