Настройка gh-actions для работы с codecov.io
This commit is contained in:
49
.github/workflows/ci.yml
vendored
Normal file
49
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# https://github.com/shivammathur/setup-php/blob/master/README.md
|
||||
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, dev ]
|
||||
pull_request:
|
||||
branches: [ master, dev ]
|
||||
|
||||
jobs:
|
||||
Tests:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php-version:
|
||||
- 8.0
|
||||
- 8.1
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Cache Composer dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.composer/cache
|
||||
key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
|
||||
restore-keys: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
|
||||
|
||||
- name: Setup PHP v ${{ matrix.php-version }}
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
extensions: json, curl, tokenizer, mbstring, xdebug
|
||||
coverage: xdebug
|
||||
tools: composer, phpunit
|
||||
|
||||
- name: Install dependencies with composer
|
||||
run: composer install --no-ansi --no-interaction --no-progress
|
||||
|
||||
- name: Run tests with phpunit/phpunit
|
||||
run: vendor/bin/phpunit --coverage-clover=coverage.xml --configuration=phpunit.xml
|
||||
|
||||
- name: Send code coverage report to Codecov.io
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
run: bash <(curl -s https://codecov.io/bash) || true
|
||||
25
.github/workflows/dev.yml
vendored
25
.github/workflows/dev.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Dev build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ dev ]
|
||||
pull_request:
|
||||
branches: [ dev ]
|
||||
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Validate composer.json and composer.lock
|
||||
uses: php-actions/composer@40-env
|
||||
with:
|
||||
version: 2
|
||||
php_version: 8.0
|
||||
only_args: --prefer-dist --no-progress
|
||||
|
||||
- name: Run phpunit tests
|
||||
uses: php-actions/phpunit@v9
|
||||
with:
|
||||
configuration: ./phpunit.xml
|
||||
25
.github/workflows/master.yml
vendored
25
.github/workflows/master.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Master build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Validate composer.json and composer.lock
|
||||
uses: php-actions/composer@40-env
|
||||
with:
|
||||
version: 2
|
||||
php_version: 7.4
|
||||
only_args: --prefer-dist --no-progress
|
||||
|
||||
- name: Run phpunit tests
|
||||
uses: php-actions/phpunit@v8
|
||||
with:
|
||||
configuration: ./phpunit.xml
|
||||
Reference in New Issue
Block a user