Skip to content

Commit

Permalink
Use Codacy (#95)
Browse files Browse the repository at this point in the history
* add codacy.yml

* Add coverage codacy

* Add slather gem

* fix token

* Update README

* update Codacy report

* Update CI

* Update CI

* Update CI

* Update CI

* Update CI

* Update CI

* Update CI

* Update CI

* Update CI

* Update CI

* Update README

* Update CI

* Update CI

* Remove old tools
  • Loading branch information
leoture committed May 4, 2020
1 parent e203029 commit a88bb44
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 52 deletions.
9 changes: 9 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
engines:
duplication:
enabled: false
exclude_paths:
- 'docs/**'
- 'fastlane/**'
- '.github/**'
- '*.md'
16 changes: 0 additions & 16 deletions .codeclimate.yml

This file was deleted.

20 changes: 3 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,14 @@ jobs:
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
swift --version
- name: Prepare Code climate
run: |
export GIT_BRANCH=${GITHUB_HEAD_REF//refs\/heads\//}
export GIT_COMMIT_SHA=$(git rev-parse HEAD)
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run fastlane
run: bundle exec fastlane mac_tests
env:
DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
- name: Code coverage
run: bash <(curl -s 'https://codecov.io/bash') -J '^MockSwift$' -t ${{secrets.CODECOV_TOKEN}}
- name: Code climate
run: |
swift --version
export GIT_BRANCH=${GITHUB_HEAD_REF//refs\/heads\//}
export GIT_COMMIT_SHA=$(git rev-parse HEAD)
xcrun xccov view --report --json fastlane/test_output/MockSwift-Package.xcresult > coverage.json
./cc-test-reporter after-build -d -t xccov --exit-code $? -r ${{ secrets.CC_TEST_REPORTER_ID }}
- name: Codacy
run: sh <(curl -Ls https://coverage.codacy.com/get.sh) report -l Swift --force-language -r cobertura.xml
env:
DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_TOKEN }}
- name: Danger
run: |
swift --version
Expand Down
17 changes: 3 additions & 14 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,11 @@ jobs:
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
swift --version
- name: Prepare Code climate
run: |
export GIT_BRANCH=master
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run fastlane
run: bundle exec fastlane mac_tests
env:
DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
- name: Code coverage
run: bash <(curl -s 'https://codecov.io/bash') -J '^MockSwift$' -t ${{secrets.CODECOV_TOKEN}}
- name: Code climate
run: |
export GIT_BRANCH=master
xcrun xccov view --report --json fastlane/test_output/MockSwift-Package.xcresult > coverage.json
./cc-test-reporter after-build -d -t xccov --exit-code $? -r ${{ secrets.CC_TEST_REPORTER_ID }}
- name: Codacy
run: sh <(curl -Ls https://coverage.codacy.com/get.sh) report -l Swift --force-language -r cobertura.xml
env:
DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ xcuserdata/
.xcmake/bin
fastlane/report.xml
fastlane/test_output
cobertura.xml
codacy-coverage.json
.codacy-coverage
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ gem 'danger-swiftformat', '~> 0.7'
gem 'danger-swiftlint', '~> 0.24'
gem 'fastlane', '~> 2.146'
gem 'jazzy', '~> 0.13'
gem 'slather', '~> 2.4'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
11 changes: 11 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ GEM
cork
nap
open4 (~> 1.3)
clamp (1.3.1)
cocoapods (1.9.1)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
Expand Down Expand Up @@ -219,6 +220,7 @@ GEM
memoist (0.16.2)
mini_magick (4.10.1)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.14.0)
molinillo (0.6.6)
multi_json (1.14.1)
Expand All @@ -230,6 +232,8 @@ GEM
naturally (2.2.0)
netrc (0.11.0)
no_proxy_fix (0.1.2)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
octokit (4.18.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
Expand Down Expand Up @@ -264,6 +268,12 @@ GEM
CFPropertyList
naturally
slack-notifier (2.3.2)
slather (2.4.8)
CFPropertyList (>= 2.2, < 4)
activesupport (>= 4.0.2, < 5)
clamp (~> 1.3)
nokogiri (~> 1.8)
xcodeproj (~> 1.7)
sqlite3 (1.4.2)
terminal-notifier (2.0.0)
terminal-table (1.8.0)
Expand Down Expand Up @@ -306,6 +316,7 @@ DEPENDENCIES
danger-swiftlint (~> 0.24)
fastlane (~> 2.146)
jazzy (~> 0.13)
slather (~> 2.4)

BUNDLED WITH
2.0.2
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Welcome to MockSwift!
=======
[![Release](https://img.shields.io/github/v/release/leoture/MockSwift?color=red)](https://github.com/leoture/MockSwift/releases)
[![Build Status](https://github.com/leoture/MockSwift/workflows/Master/badge.svg?branch=master)](https://github.com/leoture/MockSwift/actions)
[![Maintainability](https://api.codeclimate.com/v1/badges/1a16a774c75308d97f27/maintainability)](https://codeclimate.com/github/leoture/MockSwift/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/1a16a774c75308d97f27/test_coverage)](https://codeclimate.com/github/leoture/MockSwift/test_coverage)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f059404f3fbe43b3b4c4713b1afab699)](https://www.codacy.com/manual/jordhan.leoture/MockSwift?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=leoture/MockSwift&amp;utm_campaign=Badge_Grade)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/f059404f3fbe43b3b4c4713b1afab699)](https://www.codacy.com/manual/jordhan.leoture/MockSwift?utm_source=github.com&utm_medium=referral&utm_content=leoture/MockSwift&utm_campaign=Badge_Coverage)
[![documentation](https://raw.githubusercontent.com/leoture/MockSwift/master/docs/badge.svg?sanitize=true)](https://leoture.github.io/MockSwift)
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-Compatible-brightgreen)](https://github.com/apple/swift-package-manager)
[![Swift](https://img.shields.io/badge/Swift-5.2-important)](https://swift.org)
Expand Down
3 changes: 0 additions & 3 deletions codecov.yml

This file was deleted.

7 changes: 7 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ platform :mac do
code_coverage: true,
result_bundle: true
)
slather(
cobertura_xml: true,
output_directory: ".",
scheme: "MockSwift-Package",
proj: "MockSwift.xcodeproj",
workspace: "MockSwift.xcworkspace"
)
end

desc "Run MockSwiftExample tests"
Expand Down

0 comments on commit a88bb44

Please sign in to comment.