2018-04-21 05:35:53 +00:00
|
|
|
---
|
2018-10-09 12:24:36 +00:00
|
|
|
version: 2.1
|
2018-04-21 05:35:53 +00:00
|
|
|
|
2019-07-15 07:41:28 +00:00
|
|
|
orbs:
|
2022-03-09 13:04:44 +00:00
|
|
|
prometheus: prometheus/prometheus@0.16.0
|
2021-08-25 14:24:42 +00:00
|
|
|
go: circleci/go@1.7.0
|
2020-01-04 14:55:02 +00:00
|
|
|
win: circleci/windows@2.3.0
|
2019-07-15 07:41:28 +00:00
|
|
|
|
2018-10-16 07:41:45 +00:00
|
|
|
executors:
|
2019-11-25 13:59:26 +00:00
|
|
|
# Whenever the Go version is updated here, .promu.yml
|
2018-10-16 07:41:45 +00:00
|
|
|
# should also be updated.
|
|
|
|
golang:
|
2021-02-25 21:25:25 +00:00
|
|
|
docker:
|
2022-03-30 22:16:54 +00:00
|
|
|
- image: quay.io/prometheus/golang-builder:1.18-base
|
2021-12-31 14:56:29 +00:00
|
|
|
golang_oldest:
|
2018-04-21 05:35:53 +00:00
|
|
|
docker:
|
2022-03-30 22:16:54 +00:00
|
|
|
- image: quay.io/prometheus/golang-builder:1.17-base
|
2018-10-16 07:41:45 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-08-10 14:50:09 +00:00
|
|
|
test_go:
|
2018-10-16 07:41:45 +00:00
|
|
|
executor: golang
|
2018-04-21 05:35:53 +00:00
|
|
|
|
|
|
|
steps:
|
2021-06-12 10:47:47 +00:00
|
|
|
- prometheus/setup_environment
|
|
|
|
- go/load-cache:
|
|
|
|
key: v1
|
|
|
|
- run:
|
2021-08-10 14:50:09 +00:00
|
|
|
command: make GO_ONLY=1
|
2021-06-12 10:47:47 +00:00
|
|
|
environment:
|
|
|
|
# Run garbage collection more aggressively to avoid getting OOMed during the lint phase.
|
|
|
|
GOGC: "20"
|
|
|
|
# By default Go uses GOMAXPROCS but a Circle CI executor has many
|
|
|
|
# cores (> 30) while the CPU and RAM resources are throttled. If we
|
|
|
|
# don't limit this to the number of allocated cores, the job is
|
|
|
|
# likely to get OOMed and killed.
|
|
|
|
GOOPTS: "-p 2"
|
|
|
|
GOMAXPROCS: "2"
|
|
|
|
GO111MODULE: "on"
|
2021-11-19 10:11:32 +00:00
|
|
|
- run: go test ./tsdb/ -test.tsdb-isolation=false
|
2022-02-02 13:54:13 +00:00
|
|
|
- run: make -C documentation/examples/remote_storage
|
2021-06-12 10:47:47 +00:00
|
|
|
- prometheus/check_proto:
|
|
|
|
version: "3.15.8"
|
|
|
|
- prometheus/store_artifact:
|
|
|
|
file: prometheus
|
|
|
|
- prometheus/store_artifact:
|
|
|
|
file: promtool
|
|
|
|
- go/save-cache:
|
|
|
|
key: v1
|
2021-08-10 14:50:09 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: test-results
|
|
|
|
|
2021-09-10 14:27:23 +00:00
|
|
|
test_ui:
|
2021-08-10 14:50:09 +00:00
|
|
|
executor: golang
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2021-09-10 14:27:23 +00:00
|
|
|
- v3-npm-deps-{{ checksum "web/ui/package-lock.json" }}
|
2021-08-10 14:50:09 +00:00
|
|
|
- v3-npm-deps-
|
2021-09-10 14:27:23 +00:00
|
|
|
- run: make ui-install
|
2021-09-15 09:58:57 +00:00
|
|
|
- run: make ui-lint
|
2021-09-10 14:27:23 +00:00
|
|
|
- run: make ui-build-module
|
|
|
|
- run: make ui-test
|
2021-06-12 10:47:47 +00:00
|
|
|
- save_cache:
|
2021-09-10 14:27:23 +00:00
|
|
|
key: v3-npm-deps-{{ checksum "web/ui/package-lock.json" }}
|
2021-06-12 10:47:47 +00:00
|
|
|
paths:
|
2021-08-12 18:25:26 +00:00
|
|
|
- ~/.npm
|
2020-08-25 13:59:41 +00:00
|
|
|
|
2020-01-04 14:55:02 +00:00
|
|
|
test_windows:
|
2021-06-12 10:47:47 +00:00
|
|
|
executor:
|
2021-02-08 00:44:58 +00:00
|
|
|
name: win/default
|
|
|
|
shell: powershell
|
2020-01-04 14:55:02 +00:00
|
|
|
working_directory: /go/src/github.com/prometheus/prometheus
|
|
|
|
steps:
|
2021-06-12 10:47:47 +00:00
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
# Temporary workaround until circleci updates go.
|
|
|
|
command: |
|
|
|
|
choco upgrade -y golang
|
|
|
|
- run:
|
|
|
|
command: refreshenv
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
$TestTargets = go list ./... | Where-Object { $_ -NotMatch "(github.com/prometheus/prometheus/discovery.*|github.com/prometheus/prometheus/config|github.com/prometheus/prometheus/web)"}
|
|
|
|
go test $TestTargets -vet=off -v
|
|
|
|
environment:
|
|
|
|
GOGC: "20"
|
|
|
|
GOOPTS: "-p 2"
|
2020-08-25 13:59:41 +00:00
|
|
|
|
2021-12-31 14:56:29 +00:00
|
|
|
test_golang_oldest:
|
|
|
|
executor: golang_oldest
|
2021-02-25 21:25:25 +00:00
|
|
|
steps:
|
2021-06-12 10:47:47 +00:00
|
|
|
- checkout
|
2021-12-31 14:56:29 +00:00
|
|
|
- run: make build
|
2021-06-12 10:47:47 +00:00
|
|
|
- run: go test ./tsdb/...
|
2021-11-19 10:11:32 +00:00
|
|
|
- run: go test ./tsdb/ -test.tsdb-isolation=false
|
2021-02-25 21:25:25 +00:00
|
|
|
|
2020-08-25 13:59:41 +00:00
|
|
|
test_mixins:
|
|
|
|
executor: golang
|
|
|
|
steps:
|
2021-06-12 10:47:47 +00:00
|
|
|
- checkout
|
|
|
|
- run: go install ./cmd/promtool/.
|
2021-10-22 21:15:33 +00:00
|
|
|
- run: go install github.com/google/go-jsonnet/cmd/jsonnet@latest
|
|
|
|
- run: go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
|
|
|
|
- run: go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
|
|
|
|
- run: make -C documentation/prometheus-mixin clean
|
|
|
|
- run: make -C documentation/prometheus-mixin jb_install
|
|
|
|
- run: make -C documentation/prometheus-mixin
|
|
|
|
- run: git diff --exit-code
|
2020-08-25 13:59:41 +00:00
|
|
|
|
2020-06-17 14:51:32 +00:00
|
|
|
repo_sync:
|
2019-04-11 12:31:04 +00:00
|
|
|
executor: golang
|
|
|
|
steps:
|
2021-06-12 10:47:47 +00:00
|
|
|
- checkout
|
|
|
|
- run: ./scripts/sync_repo_files.sh
|
2019-04-11 12:31:04 +00:00
|
|
|
|
2018-04-21 05:35:53 +00:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
prometheus:
|
|
|
|
jobs:
|
2021-08-10 14:50:09 +00:00
|
|
|
- test_go:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2021-09-10 14:27:23 +00:00
|
|
|
- test_ui:
|
2021-08-20 09:39:07 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2021-12-31 14:56:29 +00:00
|
|
|
- test_golang_oldest:
|
2021-06-12 10:47:47 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- test_mixins:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- test_windows:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- prometheus/build:
|
|
|
|
name: build
|
2021-11-08 23:02:23 +00:00
|
|
|
parallelism: 3
|
|
|
|
promu_opts: "-p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386"
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
ignore: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
|
|
|
|
branches:
|
|
|
|
ignore: /^(main|release-.*|.*build-all.*)$/
|
|
|
|
- prometheus/build:
|
|
|
|
name: build_all
|
2021-06-12 10:47:47 +00:00
|
|
|
parallelism: 12
|
|
|
|
filters:
|
2021-11-08 23:02:23 +00:00
|
|
|
branches:
|
|
|
|
only: /^(main|release-.*|.*build-all.*)$/
|
2021-06-12 10:47:47 +00:00
|
|
|
tags:
|
|
|
|
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
|
|
|
|
- prometheus/publish_main:
|
|
|
|
context: org-context
|
|
|
|
requires:
|
2021-08-10 14:50:09 +00:00
|
|
|
- test_go
|
2021-09-10 14:27:23 +00:00
|
|
|
- test_ui
|
2021-11-08 23:02:23 +00:00
|
|
|
- build_all
|
2021-06-12 10:47:47 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: main
|
|
|
|
image: circleci/golang:1-node
|
|
|
|
- prometheus/publish_release:
|
|
|
|
context: org-context
|
|
|
|
requires:
|
2021-08-10 14:50:09 +00:00
|
|
|
- test_go
|
2021-09-10 14:27:23 +00:00
|
|
|
- test_ui
|
2021-11-08 23:02:23 +00:00
|
|
|
- build_all
|
2021-06-12 10:47:47 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
|
|
|
image: circleci/golang:1-node
|
2022-01-27 19:07:05 +00:00
|
|
|
daily:
|
2019-04-11 12:31:04 +00:00
|
|
|
triggers:
|
|
|
|
- schedule:
|
2022-01-27 19:07:05 +00:00
|
|
|
cron: "49 19 * * *"
|
2019-04-11 12:31:04 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
2021-02-22 19:19:08 +00:00
|
|
|
- main
|
2019-04-11 12:31:04 +00:00
|
|
|
jobs:
|
2021-06-12 10:47:47 +00:00
|
|
|
- repo_sync:
|
|
|
|
context: org-context
|