Skip to content

Commit

Permalink
Remove all CodeClimate references (#19682)
Browse files Browse the repository at this point in the history
  • Loading branch information
brbrr authored Apr 30, 2021
1 parent 8cbd439 commit 78ace08
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 152 deletions.
6 changes: 0 additions & 6 deletions .codeclimate.yml

This file was deleted.

67 changes: 0 additions & 67 deletions .github/codeclimate-base.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .github/files/process-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,55 +17,3 @@ echo '::endgroup::'
echo '::group::Send coverage to codecov.io'
bash <(curl -s https://codecov.io/bash) -s ./coverage || echo 'Codecov failed to upload'
echo '::endgroup::'

echo '::group::Send coverage to codeclimate.com'
# Process all the files.
FILES=()
while IFS= read -r FILE; do
TMP="${FILE#coverage/}"
TYPE="${TMP%%/*}"
if [[ "$TYPE" == 'monorepo' ]]; then
DIR="$BASE"
PREFIX="$DIR"
ADD_PREFIX=
else
TMP="${TMP#$TYPE/}"
SLUG="${TYPE}/${TMP%%/*}"
DIR="$BASE/projects/$SLUG"
if [[ "$TYPE" == "plugins" ]]; then
PREFIX="/tmp/wordpress-${WP_BRANCH}/src/wp-content/$SLUG"
else
PREFIX="$DIR"
fi
ADD_PREFIX="projects/$SLUG"
fi

cd "$DIR"
case "$FILE" in
*clover.xml)
echo "Found clover coverage file $FILE"
"$BASE/cc-test-reporter" format-coverage --prefix "$PREFIX" --add-prefix "$ADD_PREFIX" -t clover -o "$BASE/$FILE.json" "$BASE/$FILE"
FILES+=( "$FILE.json" )
;;
*lcov.info)
echo "Found lcov coverage file $FILE"
"$BASE/cc-test-reporter" format-coverage --prefix "$PREFIX" --add-prefix "$ADD_PREFIX" -t lcov -o "$BASE/$FILE.json" "$BASE/$FILE"
FILES+=( "$FILE.json" )
;;
*)
echo "Ignoring unrecognized coverage file $FILE"
;;
esac
cd "$BASE"
done < <(find coverage -type f)

if [[ "${#FILES[@]}" -gt 0 ]]; then
# Sum all coverage parts into a single coverage/codeclimate.json
./cc-test-reporter sum-coverage -p "${#FILES[@]}" "${FILES[@]}"

# Upload coverage/codeclimate.json
./cc-test-reporter upload-coverage
else
echo 'No coverage files were found.'
fi
echo '::endgroup::'
21 changes: 0 additions & 21 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,25 +97,6 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Init CodeClimate for code coverage
if: matrix.script == 'test-coverage'
env:
CC_TEST_REPORTER_ID: 683bd559e5214ca3b721092af177893f05765ba90d2589fcf35d7e85c6ea01e8
GH_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
GIT_BRANCH="${GITHUB_REF#refs/heads/}"
GIT_COMMIT_SHA="$GITHUB_SHA"
else
GIT_BRANCH="$GITHUB_HEAD_REF"
GIT_COMMIT_SHA="$GH_PR_HEAD_SHA"
fi
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
echo "GIT_COMMIT_SHA=$GIT_COMMIT_SHA" >> $GITHUB_ENV
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
- name: Detect changed projects
id: changed
run: |
Expand Down Expand Up @@ -200,8 +181,6 @@ jobs:
- name: Process coverage results
if: matrix.script == 'test-coverage'
env:
CC_TEST_REPORTER_ID: 683bd559e5214ca3b721092af177893f05765ba90d2589fcf35d7e85c6ea01e8
run: .github/files/process-coverage.sh

- name: Check for artifacts
Expand Down
5 changes: 1 addition & 4 deletions docs/monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,7 @@ If a project contains end-to-end tests, it must define `.scripts.test-e2e` in `c

If a project contains PHP or JavaScript tests, it should also define `.scripts.test-coverage` in `composer.json` to run the tests in a mode that will generate code coverage output.

Output should be written to the path specified via the `COVERAGE_DIR` environment variable. Subdirectories of that path may be used as desired, as long as the files themselves are named appropriately. Supported formats are:

* clover: Name files to end in `clover.xml`.
* lcov: Name files to end in `lcov.info`. Remove any `lcov-report` directories.
Output should be written to the path specified via the `COVERAGE_DIR` environment variable. Subdirectories of that path may be used as desired.

For PHP tests, you'll probably run PHPUnit as `phpdbg -qrr "$(which phpunit)" --coverage-clover "$COVERAGE_DIR/clover.xml"`.

Expand Down
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/remove-codeclimate
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Remove CodeClimate
1 change: 0 additions & 1 deletion projects/plugins/jetpack/readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Jetpack

[![License](https://poser.pugx.org/automattic/jetpack/license.svg)](https://www.gnu.org/licenses/gpl-2.0.html)
[![Code Climate](https://codeclimate.com/github/Automattic/jetpack/badges/gpa.svg)](https://codeclimate.com/github/Automattic/jetpack)

[Jetpack](https://jetpack.com/) is a WordPress plugin that supercharges your self-hosted WordPress site with the awesome cloud power of WordPress.com.

Expand Down
5 changes: 4 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Jetpack Monorepo

[![License](https://poser.pugx.org/automattic/jetpack/license.svg)](https://www.gnu.org/licenses/gpl-2.0.html)
[![Code Climate](https://codeclimate.com/github/Automattic/jetpack/badges/gpa.svg)](https://codeclimate.com/github/Automattic/jetpack)
[![codecov](https://codecov.io/gh/Automattic/jetpack/branch/master/graph/badge.svg?token=GmiI6Xl10U)](https://codecov.io/gh/Automattic/jetpack)

This is the Jetpack Monorepo. It contains source code for the Jetpack plugin, the Jetpack composer packages, and other things.

Expand All @@ -16,9 +16,11 @@ To run the Jetpack plugin from the monorepo, you'll first need to build the JS a
If you're using the [Docker development environment](./docs/development-environment.md#docker-supported-recommended), you should then be all set.

If not, you'll need to create a link to the Jetpack plugin from your WordPress `wp-content/plugins` folder. You'll need to know the filesystem path to the monorepo checkout and to your WordPress installation. Then, on Linux or Mac OS X, open a terminal and use `ln -s` to create the link, something like

```
ln -s /path/to/jetpack-monorepo/projects/plugins/jetpack /path/to/wordpress/wp-content/plugins/jetpack
```

On Windows (Vista and later), open an Administrator Command Prompt window and use `mklink /D` similarly.

## Contribute
Expand All @@ -41,6 +43,7 @@ Need to report a security vulnerability? Go to [https://automattic.com/security/
Jetpack is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt).

<!-- end sync section -->

## Team

Jetpack is developed and maintained by various teams at Automattic. The Jetpack Crew responsible for coordinating everything is comprised of @adimoldovan, @anomiex, @bisko, @brbrr, @briancolinger, @dereksmart, @fgiannar, @jeherve, @kbrown9, @kraftbj, @leogermani, @mdbitz, @samiff, @sdixon194, @sergeymitr and @zinigor.
Expand Down

0 comments on commit 78ace08

Please sign in to comment.