mirror of
https://github.com/kubescape/kubescape.git
synced 2026-02-14 18:09:55 +00:00
77 lines
2.0 KiB
YAML
77 lines
2.0 KiB
YAML
name: a-pr-scanner
|
|
permissions: read-all
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
RELEASE:
|
|
description: 'release'
|
|
required: true
|
|
type: string
|
|
CLIENT:
|
|
description: 'Client name'
|
|
required: true
|
|
type: string
|
|
UNIT_TESTS_PATH:
|
|
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-large
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- uses: actions/setup-go@v4
|
|
name: Installing go
|
|
with:
|
|
go-version: ${{ inputs.GO_VERSION }}
|
|
|
|
- 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
|
|
name: Setup Syft
|
|
|
|
- uses: goreleaser/goreleaser-action@v6
|
|
name: Build
|
|
with:
|
|
distribution: goreleaser
|
|
version: latest
|
|
args: build --clean --snapshot --single-target
|
|
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/cli_linux_amd64_v1/kubescape
|
|
|
|
- name: golangci-lint
|
|
continue-on-error: false
|
|
uses: golangci/golangci-lint-action@v9
|
|
with:
|
|
args: --timeout 10m
|
|
only-new-issues: true
|