Initial CLI scanner commit (#18) #111
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-test: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.16 | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Cache Go modules | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Get dependencies | |
run: | | |
go get -v -t -d ./... | |
go install github.com/onsi/ginkgo/ginkgo@v1.16.5 | |
- name: Build | |
run: go build ./... | |
- name: Test | |
run: make test | |
env: | |
SECURE_API_TOKEN: ${{ secrets.KUBELAB_SECURE_API_TOKEN }} | |
SECURE_URL: ${{ vars.SECURE_URL }} | |
docker: | |
name: Build Docker Image | |
runs-on: ubuntu-latest | |
needs: build-and-test | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v1 | |
with: | |
username: ${{ secrets.SYSDIGLABS_DOCKERHUB_USER }} | |
password: ${{ secrets.SYSDIGLABS_DOCKERHUB_TOKEN }} | |
repository: sysdiglabs/harbor-scanner-sysdig-secure | |
dockerfile: build/Dockerfile | |
add_git_labels: true | |
tags: ci |