You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
scrutiny/.github/workflows/build.yaml

61 lines
2.0 KiB

4 years ago
name: CI
# This workflow is triggered on pushes to the repository.
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
4 years ago
container: golang:1.13
4 years ago
env:
PROJECT_PATH: /go/src/github.com/analogj/scrutiny
steps:
4 years ago
- name: Checkout
uses: actions/checkout@v2
- name: Build
env:
GOOS: linux
GOARCH: amd64
run: |
4 years ago
mkdir -p $PROJECT_PATH
cp -a $GITHUB_WORKSPACE/* $PROJECT_PATH/
cd $PROJECT_PATH
go mod vendor
go test -race -coverprofile=coverage.txt -covermode=atomic -v -tags "static" $(go list ./... | grep -v /vendor/)
4 years ago
go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o scrutiny-web-linux-amd64 -tags "static" webapp/backend/cmd/scrutiny/scrutiny.go
go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o scrutiny-collector-metrics-linux-amd64 -tags "static" collector/cmd/collector-metrics/collector-metrics.go
4 years ago
chmod +x scrutiny-web-linux-amd64
chmod +x scrutiny-collector-metrics-linux-amd64
- name: Archive
uses: actions/upload-artifact@v2
with:
name: binaries
path: |
4 years ago
${{ env.PROJECT_PATH }}/scrutiny-web-linux-amd64
${{ env.PROJECT_PATH }}/scrutiny-collector-metrics-linux-amd64
- uses: codecov/codecov-action@v1
with:
file: ${{ env.PROJECT_PATH }}/coverage.txt
flags: unittests
fail_ci_if_error: true
build-docker:
name: Build Docker
runs-on: ubuntu-latest
container: docker:19.03.2
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build Docker
run: |
docker build -t analogj/scrutiny -f docker/Dockerfile .
docker save -o docker-analogj-scrutiny-latest.tar analogj/scrutiny:latest
- name: Archive Docker
uses: actions/upload-artifact@v2
with:
name: docker
path: docker-analogj-scrutiny-latest.tar