39 lines
1.0 KiB
YAML
39 lines
1.0 KiB
YAML
version: 2.1
|
|
|
|
jobs:
|
|
build:
|
|
working_directory: ~/repo
|
|
docker:
|
|
- image: cimg/go:1.19.3
|
|
steps:
|
|
- checkout
|
|
- 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: |
|
|
mkdir -p /tmp/test-reports
|
|
gotestsum --junitfile /tmp/test-reports/unit-tests.xml
|
|
- store_test_results:
|
|
path: /tmp/test-reports
|
|
- run:
|
|
name: binary
|
|
command: |
|
|
make build-server
|
|
|
|
# Invoke jobs via workflows
|
|
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
|
|
workflows:
|
|
sample: # This is the name of the workflow, feel free to change it to better match your workflow.
|
|
# Inside the workflow, you define the jobs you want to run.
|
|
jobs:
|
|
- build
|