diff --git a/.circleci/config.yml b/.circleci/config.yml index b1ae511c..f7d3c182 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,9 +9,6 @@ jobs: parameters: go_version: type: string - run_style: - type: boolean - default: false use_gomod_cache: type: boolean default: true @@ -28,10 +25,57 @@ jobs: - run: make test - run: cd sigv4 && make test - when: - condition: << parameters.run_style >> + condition: << parameters.use_gomod_cache >> + steps: + - go/save-cache: + key: v1-go<< parameters.go_version >> + - store_test_results: + path: test-results + test-assets: + parameters: + go_version: + type: string + use_gomod_cache: + type: boolean + default: true + docker: + - image: circleci/golang:<< parameters.go_version >> + working_directory: /go/src/github.com/prometheus/common/assets + steps: + - checkout + - when: + condition: << parameters.use_gomod_cache >> steps: - - run: make style - - run: cd sigv4 && make style + - go/load-cache: + key: v1-go<< parameters.go_version >> + - run: make test + - when: + condition: << parameters.use_gomod_cache >> + steps: + - go/save-cache: + key: v1-go<< parameters.go_version >> + - store_test_results: + path: ../test-results + style: + parameters: + go_version: + type: string + use_gomod_cache: + type: boolean + default: true + docker: + - image: circleci/golang:<< parameters.go_version >> + working_directory: /go/src/github.com/prometheus/common + steps: + - checkout + - when: + condition: << parameters.use_gomod_cache >> + steps: + - go/load-cache: + key: v1-go<< parameters.go_version >> + - run: make style + - run: cd sigv4 && make style + - run: cd assets && make style - when: condition: << parameters.use_gomod_cache >> steps: @@ -46,16 +90,15 @@ workflows: jobs: # Supported Go versions are synced with github.com/prometheus/client_golang. - test: - name: go-1-13 - go_version: "1.13" - - test: - name: go-1-14 - go_version: "1.14" - - test: - name: go-1-15 - go_version: "1.15" - - test: - name: go-1-16 + name: go-<< matrix.go_version >> + matrix: + parameters: + go_version: ["1.13", "1.14", "1.15", "1.16"] + - test-assets: + name: assets-go-<< matrix.go_version >> + matrix: + parameters: + go_version: ["1.16"] + - style: + name: style go_version: "1.16" - # Style is only checked against the latest supported Go version. - run_style: true