Skip to content

Commit

Permalink
chore: use Codecov and Psalm type coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsey committed Jun 10, 2022
1 parent ac52011 commit a1f4324
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 45 deletions.
70 changes: 29 additions & 41 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -66,36 +66,33 @@ jobs:
run: "composer dev:analyze:phpstan"

- name: "Statically analyze code (Psalm)"
run: "composer dev:analyze:psalm"
# NOTE: Do not report to Shepherd until the repo is public.
#run: "composer dev:analyze:psalm -- --shepherd"

# NOTE: Repository must be public to enable security analysis on GitHub.
#security-analysis:
# name: "Security analysis"
# needs: ["coding-standards", "static-analysis"]
# runs-on: "ubuntu-latest"
# steps:
# - name: "Checkout repository"
# uses: "actions/checkout@v3.0.2"
#
# - name: "Install PHP"
# uses: "shivammathur/setup-php@2.19.1"
# with:
# php-version: "latest"
# extensions: "intl-70.1"
# coverage: "none"
#
# - name: "Install dependencies (Composer)"
# uses: "ramsey/composer-install@2.1.0"
#
# - name: "Analyze security of code (Psalm)"
# run: "./vendor/bin/psalm --taint-analysis --report=build/logs/psalm.sarif"
#
# - name: "Upload security analysis results to GitHub"
# uses: "github/codeql-action/upload-sarif@v1"
# with:
# sarif_file: "build/logs/psalm.sarif"
run: "composer dev:analyze:psalm -- --shepherd"

security-analysis:
name: "Security analysis"
needs: ["coding-standards", "static-analysis"]
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v3.0.2"

- name: "Install PHP"
uses: "shivammathur/setup-php@2.19.1"
with:
php-version: "latest"
extensions: "intl-70.1"
coverage: "none"

- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@2.1.0"

- name: "Analyze security of code (Psalm)"
run: "./vendor/bin/psalm --taint-analysis --report=build/logs/psalm.sarif"

- name: "Upload security analysis results to GitHub"
uses: "github/codeql-action/upload-sarif@v1"
with:
sarif_file: "build/logs/psalm.sarif"

code-coverage:
name: "Code coverage"
Expand All @@ -119,17 +116,8 @@ jobs:
- name: "Run unit tests and generate coverage report (PHPUnit)"
run: "composer dev:test:coverage:ci"

- name: "Publish code coverage to CodeClimate"
uses: "paambaati/codeclimate-action@v3.0.0"
env:
CC_TEST_REPORTER_ID: "${{secrets.CC_TEST_REPORTER_ID}}"
with:
coverageLocations: |
${{github.workspace}}/build/coverage/clover.xml:clover
# NOTE: Use Codecov only for public repositories.
#- name: "Publish coverage report to Codecov"
# uses: "codecov/codecov-action@v3.0.0"
- name: "Publish coverage report to Codecov"
uses: "codecov/codecov-action@v3.0.0"

unit-tests:
name: "Unit tests"
Expand Down
11 changes: 7 additions & 4 deletions README.md
Expand Up @@ -5,10 +5,13 @@
<h1 align="center">FormatPHP</h1>

<p align="center">
<a href="https://github.com/skillshare/formatphp"><img src="https://img.shields.io/badge/source-skillshare/formatphp-blue.svg" alt="Source Code"></a>
<a href="https://github.com/Skillshare/formatphp/actions/workflows/continuous-integration.yml"><img src="https://github.com/Skillshare/formatphp/actions/workflows/continuous-integration.yml/badge.svg" alt="Build Status"></a>
<a href="https://codeclimate.com/repos/61787bb74596dc01a300042c/maintainability"><img src="https://api.codeclimate.com/v1/badges/ea0d6112b63107b0bd40/maintainability" /></a>
<a href="https://codeclimate.com/repos/61787bb74596dc01a300042c/test_coverage"><img src="https://api.codeclimate.com/v1/badges/ea0d6112b63107b0bd40/test_coverage" /></a>
<a href="https://github.com/skillshare/formatphp"><img src="http://img.shields.io/badge/source-skillshare/formatphp-blue.svg?style=flat-square" alt="Source Code"></a>
<a href="https://packagist.org/packages/skillshare/formatphp"><img src="https://img.shields.io/packagist/v/skillshare/formatphp.svg?style=flat-square&label=release" alt="Download Package"></a>
<a href="https://php.net"><img src="https://img.shields.io/packagist/php-v/skillshare/formatphp.svg?style=flat-square&colorB=%238892BF" alt="PHP Programming Language"></a>
<a href="https://github.com/skillshare/formatphp/blob/main/LICENSE"><img src="https://img.shields.io/packagist/l/skillshare/formatphp.svg?style=flat-square&colorB=darkcyan" alt="Read License"></a>
<a href="https://github.com/skillshare/formatphp/actions/workflows/continuous-integration.yml"><img src="https://img.shields.io/github/workflow/status/skillshare/formatphp/build/main?style=flat-square&logo=github" alt="Build Status"></a>
<a href="https://codecov.io/gh/skillshare/formatphp"><img src="https://img.shields.io/codecov/c/gh/skillshare/formatphp?label=codecov&logo=codecov&style=flat-square" alt="Codecov Code Coverage"></a>
<a href="https://shepherd.dev/github/skillshare/formatphp"><img src="https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fshepherd.dev%2Fgithub%2Fskillshare%2Fformatphp%2Fcoverage" alt="Psalm Type Coverage"></a>
</p>

<p align="center">
Expand Down

0 comments on commit a1f4324

Please sign in to comment.