Skip to content

Commit

Permalink
Merge pull request #52 from wwt/codecov
Browse files Browse the repository at this point in the history
Replaces SonarCloud analysis with CodeCov in the pipeline.

Bypassed SonarCloud checks as this removes SonarCloud.
  • Loading branch information
Richard-Gist authored Jun 16, 2021
2 parents 5b09330 + 769a862 commit 3b826f5
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 134 deletions.
27 changes: 27 additions & 0 deletions .github/.codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
codecov:
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "70...100"

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

ignore:
- "Tests/"
- "SwiftCurrentLint/"
- "Sources/SwiftCurrent/Deprecations/"
- "SwiftCurrentExample/SwiftCurrentExampleTests/"
- "SwiftCurrentExample/SwiftCurrent_UIKitTests/"

comment:
layout: "reach,diff,flags,files,footer"
behavior: default
require_changes: no
2 changes: 0 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
/.github/ @wwt/workflow-pipeline
/fastlane/ @wwt/workflow-pipeline

/sonar-project.properties @wwt/workflow-pipeline
/xccov-to-sonarqube-generic.sh @wwt/workflow-pipeline
/SwiftCurrentLint/.swiftlint.yml @wwt/workflow-pipeline

/changelog_configuration.json @wwt/workflow-pipeline
Expand Down
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
- [ ] Did you comply with our [styleguide](https://github.com/wwt/SwiftCurrent/blob/main/STYLEGUIDE.md)?
- [ ] Is there [adequate test coverage](https://github.com/wwt/SwiftCurrent/blob/main/CONTRIBUTING.md#test-etiquette) for your new code?
- [ ] Does the CI pipeline pass?
- [ ] Is the [static analysis tool](https://sonarcloud.io/dashboard?id=wwt_Workflow) reporting 0 issues?
- [ ] Did you [update the documentation](https://github.com/wwt/SwiftCurrent/blob/main/CONTRIBUTING.md#documentation)?
- [ ] Did you [update the sample app](https://github.com/wwt/SwiftCurrent/blob/main/CONTRIBUTING.md#sample-app)?
- [ ] Do we need to [increment the minor/major version](https://github.com/wwt/SwiftCurrent/blob/main/CONTRIBUTING.md#versioning)?
Expand Down
29 changes: 3 additions & 26 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,17 @@ jobs:
- uses: actions/checkout@v2
- name: Run TESTS
run: bundle exec fastlane unit_test
- name: Generate SonarCloud Friendly Coverage Report
run: ./xccov-to-sonarqube-generic.sh ~/Library/Developer/Xcode/DerivedData/Logs/Test/*.xcresult > sq-generic.xml
- name: Upload Coverage Report
uses: actions/upload-artifact@v2
- name: Codecov
uses: codecov/[email protected]
with:
name: sq-generic.xml
path: sq-generic.xml
retention-days: 1
fail_ci_if_error: true
- name: Upload Test logs
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-logs
path: ~/Library/Logs/scan
retention-days: 90
sonar_scan:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download Coverage Report
uses: actions/download-artifact@v2
with:
name: sq-generic.xml
path: artifacts
- name: Rename Paths in Coverage
run: sed 's+/Users/runner/work/SwiftCurrent/SwiftCurrent/++g' artifacts/sq-generic.xml > sq-generic.xml
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

build_for_package_managers:
needs: test
Expand Down
29 changes: 3 additions & 26 deletions .github/workflows/PR_CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,17 @@ jobs:
- uses: actions/checkout@v2
- name: Run TESTS
run: bundle exec fastlane unit_test
- name: Generate SonarCloud Friendly Coverage Report
run: ./xccov-to-sonarqube-generic.sh ~/Library/Developer/Xcode/DerivedData/Logs/Test/*.xcresult > sq-generic.xml
- name: Upload Coverage Report
uses: actions/upload-artifact@v2
- name: Codecov
uses: codecov/[email protected]
with:
name: sq-generic.xml
path: sq-generic.xml
retention-days: 1
fail_ci_if_error: true
- name: Upload Test logs
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-logs
path: ~/Library/Logs/scan
retention-days: 90
sonar_scan:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download Coverage Report
uses: actions/download-artifact@v2
with:
name: sq-generic.xml
path: artifacts
- name: Rename Paths in Coverage
run: sed 's+/Users/runner/work/SwiftCurrent/SwiftCurrent/++g' artifacts/sq-generic.xml > sq-generic.xml
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

build_for_package_managers:
needs: test
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
![Build Status](https://github.com/wwt/SwiftCurrent/actions/workflows/CI.yml/badge.svg?branch=main)
![Pod Version](https://img.shields.io/cocoapods/v/SwiftCurrent.svg?style=popout)
![Quality Gate](https://img.shields.io/sonar/quality_gate/wwt_Workflow?server=https%3A%2F%2Fsonarcloud.io)
![Coverage](https://img.shields.io/sonar/coverage/wwt_Workflow?server=http%3A%2F%2Fsonarcloud.io)
[![codecov](https://codecov.io/gh/wwt/SwiftCurrent/branch/main/graph/badge.svg?token=04Q5KSHict)](https://codecov.io/gh/wwt/SwiftCurrent)

# Welcome

SwiftCurrent is a library that lets you easily manage journeys through your Swift application.

When Developing in UIKit, each view controller has to know about the one following it in order to share data. Now imagine a flow where the first 3 screens are optional. What would it look like if you could decouple all of that?
Expand Down
2 changes: 1 addition & 1 deletion SwiftCurrentLint/.swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ type_contents_order:
file_header:
required_pattern: '// Copyright © 2021 WWT and Tyler Thompson\. All rights reserved\.'

reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging)
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, markdown, github-actions-logging)
41 changes: 0 additions & 41 deletions sonar-project.properties

This file was deleted.

35 changes: 0 additions & 35 deletions xccov-to-sonarqube-generic.sh

This file was deleted.

0 comments on commit 3b826f5

Please sign in to comment.