mirror of
https://github.com/dragonheim/gagent.git
synced 2025-01-18 04:56:28 -08:00
James Wells
48c0bc8537
All checks were successful
G'Agent Scan, Build, and Test / scan (push) Successful in 2m7s
G'Agent Scan, Build, and Test / build_simple (push) Successful in 2m36s
G'Agent Scan, Build, and Test / test_simple (push) Successful in 18s
G'Agent Scan, Build, and Test / build_image (push) Successful in 1m34s
72 lines
1.8 KiB
YAML
72 lines
1.8 KiB
YAML
name: G'Agent Scan, Build, and Test
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- releases/**
|
|
tags:
|
|
- v*
|
|
|
|
env:
|
|
SEMVAR: 0.0.13
|
|
jobs:
|
|
scan:
|
|
runs-on: docker
|
|
container:
|
|
image: dragonheim/golang:latest
|
|
steps:
|
|
- run: apk add --no-cache zeromq-dev nodejs npm
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: .cache/trivy
|
|
key: tmp.woDBBj4Baw
|
|
|
|
- run: trivy fs --no-progress --severity CRITICAL --cache-dir .cache/trivy --exit-code 1 .
|
|
- run: gosec -exclude=G114 -quiet ./...
|
|
|
|
build_simple:
|
|
needs: scan
|
|
runs-on: docker
|
|
container:
|
|
image: dragonheim/golang:latest
|
|
steps:
|
|
- run: apk add --no-cache zeromq-dev nodejs npm
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- run: go build -o test_artifact -ldflags="-X main.Version=${{ env.SEMVAR }}" cmd/gagent/main.go
|
|
- run: ./test_artifact --version
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: test_artifact
|
|
path: test_artifact
|
|
|
|
test_simple:
|
|
needs: build_simple
|
|
runs-on: docker
|
|
container:
|
|
image: dragonheim/golang:latest
|
|
steps:
|
|
- run: apk add --no-cache zeromq-dev nodejs npm
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: test_artifact
|
|
|
|
- run: chmod a+x test_artifact
|
|
- run: ./test_artifact --version
|
|
|
|
build_image:
|
|
needs: test_simple
|
|
runs-on: docker
|
|
container:
|
|
image: dragonheim/golang:latest
|
|
steps:
|
|
- run: apk add --no-cache zeromq-dev nodejs npm
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- run: echo "${{ secrets.DOCKER_LOGIN }}" | docker login -u dragonheim2024 --password-stdin
|
|
- run: docker buildx build --push -t dragonheim/gagent:test -f assets/docker/Dockerfile --build-arg SEMVER=${{ env.SEMVAR }} .
|