github.com/qri-io/qri@v0.10.1-0.20220104210721-c771715036cb/.circleci/config.yml (about)

     1  version: 2.1
     2  
     3  jobs:
     4    build:
     5      working_directory: /go/src/github.com/qri-io/qri
     6      docker:
     7        - image: circleci/golang:1.16.5
     8      environment:
     9        TEST_RESULTS: /tmp/test-results
    10        GOFLAGS: -p=8
    11      # resource_class requires a paid circleci plan:
    12      resource_class: medium+
    13      steps:
    14        - checkout
    15        - run: mkdir -p $TEST_RESULTS
    16        - restore_cache:
    17            key: dependency-cache-{{ checksum "go.sum" }}
    18        - run: 
    19            name: Get CI Deps
    20            command: go get github.com/jstemmer/go-junit-report golang.org/x/lint/golint
    21        - run:
    22            name: Lint
    23            command: golint -set_exit_status ./...
    24        - run:
    25            name: Go Vet
    26            command: go vet ./...
    27        - run:
    28            name: Run Tests
    29            command: |
    30              trap "go-junit-report <${TEST_RESULTS}/go-test.out > ${TEST_RESULTS}/go-test-report.xml" EXIT
    31              make test | tee ${TEST_RESULTS}/go-test.out
    32        - run:
    33            name: Run OAS Spec Tests
    34            command: |
    35              cd ../ && git clone https://github.com/qri-io/dataset.git &&\
    36              cd qri/docs && go test ./...
    37        - save_cache:
    38            key: dependency-cache-{{ checksum "go.sum" }}
    39            paths:
    40              - /go/pkg/mod
    41        - run:
    42            name: Publish coverage info to codecov.io
    43            command: bash <(curl -s https://codecov.io/bash)
    44        - store_artifacts:
    45            path: /tmp/test-results
    46            destination: raw-test-output
    47        - store_test_results:
    48            path: /tmp/test-results
    49    qri_benchmarks:
    50      working_directory: ~/perf
    51      docker:
    52        - image: alpine:latest
    53      resource_class: medium+
    54      steps:
    55        - checkout:
    56            path: ~/perf
    57        - run: "apk add --update curl bash"
    58        - run:
    59            name: Install Qri
    60            command: curl -fsSL https://qri.io/install.sh | sh && qri setup
    61        - run:
    62            name: Run User Benchmarks
    63            command: .circleci/user_benchmarks.sh
    64        - run: head -n 20 perf.csv
    65        - store_artifacts:
    66            path: perf.csv
    67            destination: perf.csv
    68        - run:
    69            name: Publish Results to Qri
    70            command: |
    71              qri add qri_eng/qri_cli_user_benchmarks &&\
    72              qri save --body ./perf.csv qri_eng/qri_cli_user_benchmarks &&\
    73              qri publish qri_eng/qri_cli_user_benchmarks
    74  
    75  workflows:
    76    version: 2
    77    test:
    78      jobs:
    79        - build
    80    perf:
    81      jobs:
    82      - qri_benchmarks:
    83          filters:
    84            branches:
    85              only: master