2018-04-20 22:35:53 -07:00
|
|
|
---
|
2018-10-09 05:24:36 -07:00
|
|
|
version: 2.1
|
2018-04-20 22:35:53 -07:00
|
|
|
|
2019-07-15 00:41:28 -07:00
|
|
|
orbs:
|
2021-12-14 05:41:50 -08:00
|
|
|
prometheus: prometheus/prometheus@0.15.0
|
2021-08-25 07:24:42 -07:00
|
|
|
go: circleci/go@1.7.0
|
2020-01-04 06:55:02 -08:00
|
|
|
win: circleci/windows@2.3.0
|
2019-07-15 00:41:28 -07:00
|
|
|
|
2018-10-16 00:41:45 -07:00
|
|
|
executors:
|
2019-11-25 05:59:26 -08:00
|
|
|
# Whenever the Go version is updated here, .promu.yml
|
2018-10-16 00:41:45 -07:00
|
|
|
# should also be updated.
|
|
|
|
golang:
|
2021-02-25 13:25:25 -08:00
|
|
|
docker:
|
2021-08-25 07:24:42 -07:00
|
|
|
- image: quay.io/prometheus/golang-builder:1.17-base
|
2021-12-31 06:56:29 -08:00
|
|
|
golang_oldest:
|
2018-04-20 22:35:53 -07:00
|
|
|
docker:
|
2021-12-31 06:56:29 -08:00
|
|
|
- image: quay.io/prometheus/golang-builder:1.16-base
|
2018-10-16 00:41:45 -07:00
|
|
|
|
|
|
|
jobs:
|
2021-08-10 07:50:09 -07:00
|
|
|
test_go:
|
2018-10-16 00:41:45 -07:00
|
|
|
executor: golang
|
2018-04-20 22:35:53 -07:00
|
|
|
|
|
|
|
steps:
|
2021-06-12 03:47:47 -07:00
|
|
|
- prometheus/setup_environment
|
|
|
|
- go/load-cache:
|
|
|
|
key: v1
|
|
|
|
- run:
|
2021-08-10 07:50:09 -07:00
|
|
|
command: make GO_ONLY=1
|
2021-06-12 03:47:47 -07: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 02:11:32 -08:00
|
|
|
- run: go test ./tsdb/ -test.tsdb-isolation=false
|
2022-02-02 05:54:13 -08:00
|
|
|
- run: make -C documentation/examples/remote_storage
|
2021-06-12 03:47:47 -07: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 07:50:09 -07:00
|
|
|
- store_test_results:
|
|
|
|
path: test-results
|
|
|
|
|
2021-09-10 07:27:23 -07:00
|
|
|
test_ui:
|
2021-08-10 07:50:09 -07:00
|
|
|
executor: golang
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2021-09-10 07:27:23 -07:00
|
|
|
- v3-npm-deps-{{ checksum "web/ui/package-lock.json" }}
|
2021-08-10 07:50:09 -07:00
|
|
|
- v3-npm-deps-
|
2021-09-10 07:27:23 -07:00
|
|
|
- run: make ui-install
|
2021-09-15 02:58:57 -07:00
|
|
|
- run: make ui-lint
|
2021-09-10 07:27:23 -07:00
|
|
|
- run: make ui-build-module
|
|
|
|
- run: make ui-test
|
2021-06-12 03:47:47 -07:00
|
|
|
- save_cache:
|
2021-09-10 07:27:23 -07:00
|
|
|
key: v3-npm-deps-{{ checksum "web/ui/package-lock.json" }}
|
2021-06-12 03:47:47 -07:00
|
|
|
paths:
|
2021-08-12 11:25:26 -07:00
|
|
|
- ~/.npm
|
2020-08-25 06:59:41 -07:00
|
|
|
|
2020-01-04 06:55:02 -08:00
|
|
|
test_windows:
|
2021-06-12 03:47:47 -07:00
|
|
|
executor:
|
2021-02-07 16:44:58 -08:00
|
|
|
name: win/default
|
|
|
|
shell: powershell
|
2020-01-04 06:55:02 -08:00
|
|
|
working_directory: /go/src/github.com/prometheus/prometheus
|
|
|
|
steps:
|
2021-06-12 03:47:47 -07:00
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
# Temporary workaround until circleci updates go.
|
|
|
|
command: |
|
|
|
|
choco upgrade -y golang
|
|
|
|
- run:
|
|
|
|
command: refreshenv
|
|
|
|
- run:
|
|
|
|
command: |
|
2021-11-26 01:11:26 -08:00
|
|
|
$env:GOARCH=""; $env:GOOS=""; cd web/ui; go generate
|
|
|
|
cd ../..
|
2021-06-12 03:47:47 -07:00
|
|
|
$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 06:59:41 -07:00
|
|
|
|
2021-12-31 06:56:29 -08:00
|
|
|
test_golang_oldest:
|
|
|
|
executor: golang_oldest
|
2021-02-25 13:25:25 -08:00
|
|
|
steps:
|
2021-06-12 03:47:47 -07:00
|
|
|
- checkout
|
2021-12-31 06:56:29 -08:00
|
|
|
- run: make build
|
2021-06-12 03:47:47 -07:00
|
|
|
- run: go test ./tsdb/...
|
2021-11-19 02:11:32 -08:00
|
|
|
- run: go test ./tsdb/ -test.tsdb-isolation=false
|
2021-02-25 13:25:25 -08:00
|
|
|
|
2020-08-25 06:59:41 -07:00
|
|
|
test_mixins:
|
|
|
|
executor: golang
|
|
|
|
steps:
|
2021-06-12 03:47:47 -07:00
|
|
|
- checkout
|
|
|
|
- run: go install ./cmd/promtool/.
|
2021-10-22 14:15:33 -07: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 06:59:41 -07:00
|
|
|
|
2020-06-17 07:51:32 -07:00
|
|
|
repo_sync:
|
2019-04-11 05:31:04 -07:00
|
|
|
executor: golang
|
|
|
|
steps:
|
2021-06-12 03:47:47 -07:00
|
|
|
- checkout
|
|
|
|
- run: ./scripts/sync_repo_files.sh
|
2021-09-24 06:54:25 -07:00
|
|
|
- run: ./scripts/sync_codemirror.sh
|
2019-04-11 05:31:04 -07:00
|
|
|
|
2018-04-20 22:35:53 -07:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
prometheus:
|
|
|
|
jobs:
|
2021-08-10 07:50:09 -07:00
|
|
|
- test_go:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2021-09-10 07:27:23 -07:00
|
|
|
- test_ui:
|
2021-08-20 02:39:07 -07:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2021-12-31 06:56:29 -08:00
|
|
|
- test_golang_oldest:
|
2021-06-12 03:47:47 -07:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- test_mixins:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- test_windows:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- prometheus/build:
|
|
|
|
name: build
|
2021-11-08 15:02:23 -08: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 03:47:47 -07:00
|
|
|
parallelism: 12
|
|
|
|
filters:
|
2021-11-08 15:02:23 -08:00
|
|
|
branches:
|
|
|
|
only: /^(main|release-.*|.*build-all.*)$/
|
2021-06-12 03:47:47 -07:00
|
|
|
tags:
|
|
|
|
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
|
|
|
|
- prometheus/publish_main:
|
|
|
|
context: org-context
|
|
|
|
requires:
|
2021-08-10 07:50:09 -07:00
|
|
|
- test_go
|
2021-09-10 07:27:23 -07:00
|
|
|
- test_ui
|
2021-11-08 15:02:23 -08:00
|
|
|
- build_all
|
2021-06-12 03:47:47 -07:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: main
|
|
|
|
image: circleci/golang:1-node
|
|
|
|
- prometheus/publish_release:
|
|
|
|
context: org-context
|
|
|
|
requires:
|
2021-08-10 07:50:09 -07:00
|
|
|
- test_go
|
2021-09-10 07:27:23 -07:00
|
|
|
- test_ui
|
2021-11-08 15:02:23 -08:00
|
|
|
- build_all
|
2021-06-12 03:47:47 -07:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
|
|
|
image: circleci/golang:1-node
|
2022-01-27 11:07:05 -08:00
|
|
|
daily:
|
2019-04-11 05:31:04 -07:00
|
|
|
triggers:
|
|
|
|
- schedule:
|
2022-01-27 11:07:05 -08:00
|
|
|
cron: "49 19 * * *"
|
2019-04-11 05:31:04 -07:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
2021-02-22 11:19:08 -08:00
|
|
|
- main
|
2019-04-11 05:31:04 -07:00
|
|
|
jobs:
|
2021-06-12 03:47:47 -07:00
|
|
|
- repo_sync:
|
|
|
|
context: org-context
|