Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fb11c0c27c | |||
| 27cc67d2cf | |||
| 0fe13439b6 | |||
| fb9caec663 | |||
| e3e83630b5 |
59
.circleci/config.yml
Normal file
59
.circleci/config.yml
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
# Use the latest 2.1 version of CircleCI pipeline process engine.
|
||||||
|
# See: https://circleci.com/docs/2.0/configuration-reference
|
||||||
|
version: 2.1
|
||||||
|
|
||||||
|
commands:
|
||||||
|
setup-bazel:
|
||||||
|
description: |
|
||||||
|
Setup the Bazel build system used for building the repo
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Add Bazel Apt repository
|
||||||
|
command: |
|
||||||
|
sudo apt install curl gnupg
|
||||||
|
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
|
||||||
|
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
|
||||||
|
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
|
||||||
|
- run:
|
||||||
|
name: Install Bazel from Apt
|
||||||
|
command: sudo apt update && sudo apt install bazel
|
||||||
|
|
||||||
|
# Define a job to be invoked later in a workflow.
|
||||||
|
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
|
||||||
|
jobs:
|
||||||
|
testbuild:
|
||||||
|
working_directory: ~/repo
|
||||||
|
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
|
||||||
|
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
|
||||||
|
docker:
|
||||||
|
- image: circleci/golang:1.15.8
|
||||||
|
# Add steps to the job
|
||||||
|
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- setup-bazel
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- go-mod-v4-{{ checksum "go.sum" }}
|
||||||
|
- run:
|
||||||
|
name: Install Dependencies
|
||||||
|
command: go mod download
|
||||||
|
- save_cache:
|
||||||
|
key: go-mod-v4-{{ checksum "go.sum" }}
|
||||||
|
paths:
|
||||||
|
- "/go/pkg/mod"
|
||||||
|
- run:
|
||||||
|
name: Run tests
|
||||||
|
command: bazel test //...
|
||||||
|
- run:
|
||||||
|
name: Run build
|
||||||
|
command: bazel build //...
|
||||||
|
- store_test_results:
|
||||||
|
path: /tmp/test-reports
|
||||||
|
|
||||||
|
# Invoke jobs via workflows
|
||||||
|
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
|
||||||
|
workflows:
|
||||||
|
testbuild:
|
||||||
|
jobs:
|
||||||
|
- testbuild
|
||||||
@@ -143,11 +143,13 @@ func Setup(opts *Options) error {
|
|||||||
|
|
||||||
log.p = priority
|
log.p = priority
|
||||||
|
|
||||||
|
if opts.WriteSyslog {
|
||||||
var err error
|
var err error
|
||||||
log.l, err = gsyslog.NewLogger(priority, opts.Facility, opts.Tag)
|
log.l, err = gsyslog.NewLogger(priority, opts.Facility, opts.Tag)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user