Skip to content

Commit

Permalink
Update pipelines (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Nov 18, 2020
1 parent 0161791 commit fc2e6d1
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 37 deletions.
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -3,5 +3,4 @@
| Is bugfix? | ✔️/❌
| New feature? | ✔️/❌
| Breaks BC? | ✔️/❌
| Tests pass? | ✔️/❌
| Fixed issues | comma-separated list of tickets # fixed by the PR, if any
15 changes: 15 additions & 0 deletions .github/workflows/bc.yml_
@@ -0,0 +1,15 @@
on:
- pull_request
- push

name: backwards compatibility
jobs:
roave_bc_check:
name: Roave BC Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Roave BC Check
uses: docker://nyholm/roave-bc-check-ga
26 changes: 9 additions & 17 deletions .github/workflows/build.yml
Expand Up @@ -25,9 +25,9 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4

- name: Install PHP with extensions
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
Expand All @@ -37,20 +37,23 @@ jobs:

- name: Determine composer cache directory on Linux
if: matrix.os == 'ubuntu-latest'
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Determine composer cache directory on Windows
if: matrix.os == 'windows-latest'
run: ECHO "::set-env name=COMPOSER_CACHE_DIR::~\AppData\Local\Composer"
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Cache dependencies installed with composer
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update

- name: Install dependencies with composer php 7.4
if: matrix.php == '7.4'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
Expand All @@ -59,16 +62,5 @@ jobs:
if: matrix.php == '8.0'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests with phpunit and coverage on Linux php 7.4
if: matrix.os == 'ubuntu-latest' && matrix.php == '7.4'
run: vendor/bin/phpunit --coverage-clover=coverage.clover --colors=always

- name: Run tests with phpunit without coverage on Windows php 7.4 - 8.0 and Linux php 8.0
if: matrix.os != 'ubuntu-latest' || matrix.php != '7.4'
- name: Run tests with phpunit
run: vendor/bin/phpunit --colors=always

- name: Upload code coverage scrutinizer on Linux php 7.4
if: matrix.os == 'ubuntu-latest' && matrix.php == '7.4'
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
17 changes: 8 additions & 9 deletions .github/workflows/mutation.yml
Expand Up @@ -10,9 +10,6 @@ jobs:
mutation:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

env:
update: true

runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -25,7 +22,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -36,7 +33,7 @@ jobs:
tools: composer:v2

- name: Determine composer cache directory
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v2
Expand All @@ -46,13 +43,15 @@ jobs:
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update

- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run test mutation infection with coverage
- name: Run infection
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-xml=build/logs/coverage-xml --log-junit=build/logs/junit.xml --colors=always
vendor/bin/infection --threads=2 --coverage=build/logs --show-mutations --no-progress --skip-initial-tests --min-msi=70 --min-covered-msi=70
git fetch --depth=1 origin $GITHUB_BASE_REF
vendor/bin/roave-infection-static-analysis-plugin -j2 --git-diff-filter=A --git-diff-base=origin/$GITHUB_BASE_REF --logger-github --ignore-msi-with-no-mutations --only-covered
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
12 changes: 6 additions & 6 deletions .github/workflows/static.yml
Expand Up @@ -8,9 +8,6 @@ jobs:
mutation:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

env:
update: true

runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -23,17 +20,17 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4

- name: Install PHP"
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
tools: composer:v2, cs2pr
coverage: none

- name: Determine composer cache directory
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v2
Expand All @@ -43,6 +40,9 @@ jobs:
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update

- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

Expand Down
47 changes: 45 additions & 2 deletions README.md
Expand Up @@ -27,6 +27,7 @@ Documentation is at [docs/guide/README.md](docs/guide/README.md).
[![Code Coverage](https://scrutinizer-ci.com/g/yiisoft/yii-bootstrap5/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/yii-bootstrap5/?branch=master)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fyii-bootstrap5%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/yii-bootstrap5/master)
[![static analysis](https://github.com/yiisoft/yii-bootstrap5/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/yii-bootstrap5/actions?query=workflow%3A%22static+analysis%22)
[![type-coverage](https://shepherd.dev/github/yiisoft/yii-bootstrap5/coverage.svg)](https://shepherd.dev/github/yiisoft/yii-bootstrap5)

Installation
------------
Expand All @@ -37,12 +38,54 @@ The preferred way to install this extension is through [composer](http://getcomp
php composer.phar require --prefer-dist yiisoft/yii-bootstrap5
```

Usage
----
## General usage

For example, the following
single line of code in a view file would render a Bootstrap Progress plugin:

```php
<?= Yiisoft\Yii\Bootstrap5\Progress::widget(['percent' => 60, 'label' => 'test']) ?>
```

### Unit testing

The package is tested with [PHPUnit](https://phpunit.de/). To run tests:

```shell
./vendor/bin/phpunit
```

### Mutation testing

The package tests are checked with [Infection](https://infection.github.io/) mutation framework. To run it:

```shell
./vendor/bin/infection
```

### Static analysis

The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:

```shell
./vendor/bin/psalm
```

### Support the project

[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective&logoColor=7eadf1&labelColor=555555)](https://opencollective.com/yiisoft)

### Follow updates

[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)
[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/yiiframework)
[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat&logo=telegram)](https://t.me/yii3en)
[![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat&logo=facebook&logoColor=ffffff)](https://www.facebook.com/groups/yiitalk)
[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat&logo=slack)](https://yiiframework.com/go/slack)

## License

The Yii Framework Twitter Bootstrap 5 Extension is free software. It is released under the terms of the BSD License.
Please see [`LICENSE`](./LICENSE.md) for more information.

Maintained by [Yii Software](https://www.yiiframework.com/).
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -27,9 +27,9 @@
"yiisoft/widget": "^3.0@dev"
},
"require-dev": {
"infection/infection": "^0.19.0",
"phpunit/phpunit": "^9.4",
"vimeo/psalm": "^4.0",
"roave/infection-static-analysis-plugin": "^1.4",
"vimeo/psalm": "^4.1",
"yiisoft/aliases": "^1.0",
"yiisoft/di": "^3.0@dev"
},
Expand Down

0 comments on commit fc2e6d1

Please sign in to comment.