Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise code climate recipe #543

Open
fbrdaric opened this issue Oct 1, 2019 · 1 comment
Open

Revise code climate recipe #543

fbrdaric opened this issue Oct 1, 2019 · 1 comment
Assignees

Comments

@fbrdaric
Copy link

fbrdaric commented Oct 1, 2019

@csidyel I'm referring to this documentation page. One customer reported he found it a little bit confusing since not all the env variables in the examples are standard. He's proposing a bit cleaner version:

    task:
      prologue:
        commands:
          - checkout
          - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
          - chmod +x ./cc-test-reporter
          - ./cc-test-reporter before-build
      epilogue:
        commands:
          # format and upload each job's coverage data to S3
          - ./cc-test-reporter format-coverage --output "coverage/codeclimate.$SEMAPHORE_JOB_ID.json"
          - aws s3 cp ./coverage/codeclimate.$SEMAPHORE_JOB_ID.json "s3://my_coverage_bucket/$SEMAPHORE_PROJECT_NAME/$SEMAPHORE_GIT_BRANCH/coverage/$SEMAPHORE_WORKFLOW_ID/"
      jobs:        
        - name: Rspec-Rails
          parallelism: 12
          commands:
            - rspec_booster --job $SEMAPHORE_JOB_INDEX/$SEMAPHORE_JOB_COUNT
- name: CodeClimate Upload All
    dependencies: ["Tests"]
    task:
      jobs:
        - name: Sync to CC
          commands:
            - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
            - chmod +x ./cc-test-reporter
            # Download the individual segments from S3 and dump them in ./coverage
            - aws s3 sync "s3://my_coverage_bucket/$SEMAPHORE_PROJECT_NAME/$SEMAPHORE_GIT_BRANCH/coverage/$SEMAPHORE_WORKFLOW_ID/" coverage/
            - echo $(ls -1 coverage/ | wc -l) Coverage Files Found
            # concat the files together and upload to Code Climate
            - ./cc-test-reporter sum-coverage --output coverage/codeclimate.json --parts $(ls -1 coverage/ | wc -l) coverage/codeclimate.*.json
            - ./cc-test-reporter upload-coverage

Can you please review the proposal and make necessary changes?

@csidyel
Copy link
Collaborator

csidyel commented Oct 2, 2019

I updated the docs based on the customer's feedback. However, I haven't included the whole example he provided because it seems very molded to his use-case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants