/
config.yml
102 lines (84 loc) · 2.37 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
defaults: &defaults
docker:
- image: circleci/golang:1.10
working_directory: /go/src/github.com/ernoaapa/eliot
version: 2
jobs:
test:
<<: *defaults
steps:
- checkout
- run: "! go fmt -l pkg cmd 2>&1 | read"
- run: go vet ./...
# Run tests with overalls to generate also coverage report
- run: go get github.com/go-playground/overalls
- run: overalls -project=github.com/ernoaapa/eliot -covermode=atomic -- -race -v
# Send reports to codecov
- run: |
mv overalls.coverprofile coverage.txt
bash <(curl -s https://codecov.io/bash)
build:
<<: *defaults
steps:
- checkout
- setup_remote_docker
- run: ./build/install-build-tools.sh
- run: goreleaser --snapshot
publish:
<<: *defaults
steps:
- checkout
- setup_remote_docker
- run:
name: Login Docker hub
command: echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin
- run: ./build/install-build-tools.sh
- run: goreleaser
- run: .circleci/scripts/push-docker-manifest.sh $(git describe --tags --always --dirty)
- run:
name: Publish Linux packages
command: |
for package in dist/eliot_*.deb; do
pkgcloud-push ernoaapa/eliot/raspbian/stretch $package
done
deps_build_and_release:
<<: *defaults
steps:
- checkout
- run: ./build/install-build-tools.sh
- run:
name: Install build dependencies
command: sudo apt-get update && sudo apt-get install -y btrfs-tools libseccomp-dev
- run:
name: build & release deps
command: GOOS=linux GOARCH=amd64 ./deps/publish-all.sh
workflows:
version: 2
deps:
jobs:
- deps_build_and_release
build_and_test:
jobs:
- test:
filters:
branches:
ignore: /gh-pages/
tags:
only: /.*/
- build:
requires:
- test
filters:
tags:
only: /.*/
- publish:
requires:
- test
- build
# Don't run when branches updates, only when tags get created
filters:
branches:
ignore: /.*/
tags:
only:
- /v.*/