diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 91690ebe47..64a54ee95d 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -5,11 +5,12 @@ on: - cron: '0 5 * * *' #Runs daily at 5 AM UTC push: branches: - - master - - develop - pull_request: - branches: - - develop + - CV2-4794-migrate-travis-ci + # - master + # - develop + # pull_request: + # branches: + # - develop env: CC_TEST_REPORTER_ID: "${{ secrets.CC_TEST_REPORTER_ID }}" @@ -281,12 +282,4 @@ jobs: CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} run: | docker-compose exec -T -e GIT_BRANCH=$GIT_BRANCH \ - -e GITHUB_PULL_REQUEST=$GITHUB_PULL_REQUEST \ - -e GITHUB_TEST_RESULT=$GITHUB_TEST_RESULT \ - -e GITHUB_REPO_SLUG=$GITHUB_REPO_SLUG \ - -e GITHUB_BUILD_NUMBER=$ GITHUB_BUILD_NUMBER \ - -e GIT_COMMIT_SHA=$GITHUB_COMMIT_SHA \ - -e CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID \ - -e GITHUB_JOB_NAME=$GITHUB_JOB_NAME \ - -e AWS_CONFIG_FILE=/app/credentials \ api test/test-coverage.sh \ No newline at end of file diff --git a/test/cc-test-reporter b/test/cc-test-reporter new file mode 100755 index 0000000000..99884251fe --- /dev/null +++ b/test/cc-test-reporter @@ -0,0 +1,2 @@ +#!/bin/bash +go run /tmp/go/src/github.com/codeclimate/test-reporter/main.go $@ diff --git a/test/format-coverage.sh b/test/format-coverage.sh index 5c1c3798f5..eec006b7b6 100755 --- a/test/format-coverage.sh +++ b/test/format-coverage.sh @@ -2,8 +2,8 @@ apt-get install -y awscli -# if [ "$GITHUB_PULL_REQUEST" == "false" ] -# then +if [ "$GITHUB_PULL_REQUEST" == "false" ] +then ./test/cc-test-reporter format-coverage -t simplecov --output ../coverage/codeclimate.$GITHUB_JOB_NAME.json ../coverage/.resultset.json aws s3 cp ../coverage/codeclimate.$GITHUB_JOB_NAME.json s3://check-api-travis/codeclimate/$GITHUB_REPO_SLUG/$GITHUB_BUILD_NUMBER/codeclimate.$GITHUB_JOB_NAME.json -# fi +fi diff --git a/test/sum-upload-coverage.sh b/test/sum-upload-coverage.sh index c98dac5ec5..f1b3ab3300 100755 --- a/test/sum-upload-coverage.sh +++ b/test/sum-upload-coverage.sh @@ -1,7 +1,7 @@ #!/bin/bash -# if [[ "$GITHUB_PULL_REQUEST" == "false" ]] && [[ $GITHUB_TEST_RESULT == 0 ]] -# then +if [[ "$GITHUB_PULL_REQUEST" == "false" ]] && [[ $GITHUB_TEST_RESULT == 0 ]] +then rm -rf ../coverage/* aws s3 cp --recursive s3://check-api-travis/codeclimate/$GITHUB_REPO_SLUG/$GITHUB_BUILD_NUMBER/ ../coverage if [[ $(ls ../coverage/codeclimate.* | wc -l) -eq 3 ]] @@ -19,4 +19,4 @@ cat ../coverage/codeclimate.json | ./cc-test-reporter upload-coverage --input - ./cc-test-reporter show-coverage ../coverage/codeclimate.json fi -# fi +fi