This repository has been archived by the owner on Jan 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c59ce8
commit 902b29a
Showing
7 changed files
with
121 additions
and
159 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,19 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
working_directory: /content-collection-unfolder | ||
docker: | ||
- image: golang:1 | ||
environment: | ||
GOPATH: /go | ||
CIRCLE_TEST_REPORTS: /tmp/test-results | ||
CIRCLE_COVERAGE_REPORT: /tmp/coverage-results | ||
steps: | ||
- checkout | ||
- run: | ||
name: External Dependencies | ||
command: | | ||
GO111MODULE=off go get github.com/mattn/goveralls | ||
GO111MODULE=off go get github.com/jstemmer/go-junit-report | ||
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0 | ||
wget https://raw.githubusercontent.com/Financial-Times/upp-coding-standard/v1.0.0/golangci-config/.golangci.yml | ||
- run: | ||
name: Create Test Folders | ||
command: | | ||
mkdir -p $CIRCLE_TEST_REPORTS | ||
mkdir -p $CIRCLE_COVERAGE_REPORT | ||
- run: | ||
name: Go Build | ||
command: go build -mod=readonly -v | ||
- run: | ||
name: Run linters | ||
command: golangci-lint run --new-from-rev=$(git rev-parse origin/master) --config .golangci.yml | ||
- run: | ||
name: Run Tests | ||
command: go test -mod=readonly -race -cover -coverprofile=${CIRCLE_COVERAGE_REPORT}/coverage.out ./... | go-junit-report > ${CIRCLE_TEST_REPORTS}/junit.xml | ||
- run: | ||
name: Upload Coverage | ||
command: goveralls -coverprofile=${CIRCLE_COVERAGE_REPORT}/coverage.out -service=circle-ci -repotoken=${COVERALLS_TOKEN} | ||
- store_test_results: | ||
path: /tmp/test-results | ||
dockerfile: | ||
working_directory: /content-collection-unfolder | ||
docker: | ||
- image: docker:18 | ||
steps: | ||
- checkout | ||
- setup_docker_engine | ||
- run: | ||
name: Build Dockerfile | ||
command: docker build . | ||
version: 2.1 | ||
|
||
orbs: | ||
ft-golang-ci: financial-times/golang-ci@1 | ||
|
||
workflows: | ||
version: 2 | ||
test-and-build-docker: | ||
tests_and_docker: | ||
jobs: | ||
- build | ||
- dockerfile: | ||
- ft-golang-ci/build-and-test: | ||
name: build-and-test-project | ||
- ft-golang-ci/docker-build: | ||
name: build-docker-image | ||
requires: | ||
- build | ||
- build-and-test-project | ||
snyk-scanning: | ||
jobs: | ||
- ft-golang-ci/scan: | ||
name: scan-dependencies | ||
context: cm-team-snyk |
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
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
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
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
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
Oops, something went wrong.