mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-15 06:58:11 +00:00
105 lines
3.1 KiB
YAML
105 lines
3.1 KiB
YAML
name: build-dev
|
|
|
|
on:
|
|
push:
|
|
branches: [ dev ]
|
|
jobs:
|
|
build:
|
|
name: Create cross-platform dev build
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.18
|
|
|
|
# - name: Test cmd pkg
|
|
# run: cd cmd && go test -v ./...
|
|
|
|
# - name: Test core pkg
|
|
# env:
|
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# run: cd core && go test -v ./...
|
|
|
|
# - name: Test cmd pkg
|
|
# run: cd cmd && go test -v ./...
|
|
|
|
- name: Install libgit2
|
|
run: make libgit2
|
|
if: matrix.os != 'windows-latest'
|
|
|
|
- name: Test core pkg
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: go test -tags=static -v ./...
|
|
|
|
- name: Test httphandler pkg
|
|
run: cd httphandler && go test -tags=static -v ./...
|
|
|
|
- name: Build
|
|
env:
|
|
RELEASE: v2.0.${{ github.run_number }}
|
|
CLIENT: release-dev
|
|
ArmoBEServer: api.armo.cloud
|
|
ArmoAuthServer: auth.armo.cloud
|
|
ArmoERServer: report.armo.cloud
|
|
ArmoWebsite: portal.armo.cloud
|
|
CGO_ENABLED: 1
|
|
run: python3 --version && python3 build.py
|
|
|
|
- name: Smoke Testing
|
|
env:
|
|
RELEASE: v2.0.${{ github.run_number }}
|
|
KUBESCAPE_SKIP_UPDATE_CHECK: "true"
|
|
run: python3 smoke_testing/init.py ${PWD}/build/${{ matrix.os }}/kubescape
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: kubescape-${{ matrix.os }}
|
|
path: build/${{ matrix.os }}/kubescape
|
|
|
|
build-docker:
|
|
name: Build docker container, tag and upload to registry
|
|
needs: build
|
|
if: ${{ github.repository == 'armosec/kubescape' }} # TODO
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write
|
|
packages: write
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Set image version
|
|
id: image-version
|
|
run: echo '::set-output name=IMAGE_VERSION::dev-v2.0.${{ github.run_number }}'
|
|
|
|
- name: Set image name
|
|
id: image-name
|
|
run: echo '::set-output name=IMAGE_NAME::quay.io/${{ github.repository_owner }}/kubescape'
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Login to Quay.io
|
|
env:
|
|
QUAY_PASSWORD: ${{ secrets.QUAYIO_REGISTRY_PASSWORD }}
|
|
QUAY_USERNAME: ${{ secrets.QUAYIO_REGISTRY_USERNAME }}
|
|
run: docker login -u="${QUAY_USERNAME}" -p="${QUAY_PASSWORD}" quay.io
|
|
|
|
- name: Build the Docker image
|
|
run: docker buildx build . --file build/Dockerfile --tag ${{ steps.image-name.outputs.IMAGE_NAME }}:${{ steps.image-version.outputs.IMAGE_VERSION }} --build-arg image_version=${{ steps.image-version.outputs.IMAGE_VERSION }} --build-arg client=image-dev --push --platform linux/amd64,linux/arm64
|