Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from Travis to Github Actions
- Loading branch information
1 parent
23cacbb
commit d9f2184
Showing
5 changed files
with
92 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
service_name: travis-ci | ||
service_name: php-coveralls | ||
coverage_clover: build/logs/clover.xml | ||
json_path: build/logs/coveralls-upload.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
|
||
tests: | ||
name: Tests | ||
|
||
env: | ||
extensions: mbstring | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- php: '7.1' | ||
- php: '7.2' | ||
- php: '7.3' | ||
- php: '7.4' | ||
coverage: yes | ||
- php: '8.0' | ||
- php: '8.1' | ||
fail-fast: false | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
coverage: "xdebug" | ||
ini-values: date.timezone=Europe/Kiev,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,apc.enable_cli=1,zend.assertions=1 | ||
php-version: "${{ matrix.php }}" | ||
extensions: "${{ env.extensions }}" | ||
|
||
- name: Configure environment | ||
run: | | ||
php -v | ||
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION ;") | ||
echo $PHP_VERSION | ||
mkdir -p build/logs | ||
- name: Install dependencies | ||
run: | | ||
composer install -o -q --no-suggest | ||
- name: Run phpcs and phpunit | ||
if: "matrix.coverage != 'yes'" | ||
run: | | ||
composer phpcs | ||
vendor/bin/phpunit | ||
- name: Run phpunit with coverage report | ||
if: "matrix.coverage == 'yes'" | ||
run: | | ||
vendor/bin/phpunit --coverage-clover build/logs/clover.xml | ||
- name: Send coverage | ||
if: "matrix.coverage == 'yes'" | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_PARALLEL: true | ||
COVERALLS_FLAG_NAME: "PHP ${{ matrix.php }}" | ||
run: | | ||
composer require "php-coveralls/php-coveralls:~2.5" | ||
php vendor/bin/php-coveralls -v | ||
curl -k https://coveralls.io/webhook?repo_token=${{ secrets.GITHUB_TOKEN }} -d "repo_name=$GITHUB_REPOSITORY&payload[build_num]=$GITHUB_RUN_ID&payload[status]=done" | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters