From 580a07ebbbc66f6f5339524952bb26414ae8d91e Mon Sep 17 00:00:00 2001 From: Povilas Susinskas Date: Sat, 27 Feb 2021 18:16:42 +0100 Subject: [PATCH] Use Github Actions --- .gitattributes | 2 -- .github/workflows/ci.yaml | 29 ++++++++++++++++++++++ .travis.yml | 45 --------------------------------- README.md | 5 ++-- appveyor.yml | 52 --------------------------------------- 5 files changed, 31 insertions(+), 102 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.gitattributes b/.gitattributes index 3def1bb..5ce1916 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,7 +4,6 @@ .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore -.travis.yml export-ignore CHANGELOG.md export-ignore CONTRIBUTING.md export-ignore LICENSE export-ignore @@ -13,4 +12,3 @@ README.md export-ignore tests/ export-ignore box.json.dist export-ignore build/ export-ignore -appveyor.yml export-ignore diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..5b3dace --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,29 @@ +name: CI +on: + push: + pull_request: +jobs: + tests: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest, windows-latest, macOS-latest] + php-version: ['7.1', '7.2', '7.3', '7.4', 8.0'] + name: PHP ${{ matrix.php-version }} Test on ${{ matrix.operating-system }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ~/.composer/cache/files + key: dependencies-composer-${{ hashFiles('composer.json') }} + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer:v2 + - name: Install Composer dependencies + run: composer install --prefer-dist --no-interaction --no-suggest + - name: Execute tests + run: vendor/bin/phpunit --verbose diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 86da6ee..0000000 --- a/.travis.yml +++ /dev/null @@ -1,45 +0,0 @@ -language: php - -git: - depth: 1 - -matrix: - include: - - php: 7.1 - - php: 7.2 - env: LINT=true - - php: 7.2 - env: COMPOSER_FLAGS="--prefer-lowest" - - php: 7.3 - env: LINT=true - - php: 7.3 - env: COMPOSER_FLAGS="--prefer-lowest" - - php: 7.4 - env: LINT=true - - php: 7.4 - env: COMPOSER_FLAGS="--prefer-lowest" - - php: 8.0 - env: LINT=true - - php: 8.0 - env: COMPOSER_FLAGS="--prefer-lowest" - - fast_finish: true - -sudo: false - -cache: - directories: - - $HOME/.composer/cache - -before_install: - - composer update -n $COMPOSER_FLAGS - -script: - - vendor/bin/phpunit - # Verify coding standard compliance only once - - if [[ $LINT = true ]]; then - composer cs-check; - fi - -notifications: - email: false diff --git a/README.md b/README.md index 6ce422b..5c17c65 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/povils/phpmnd/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/povils/phpmnd/?branch=master) [![License](https://poser.pugx.org/povils/phpmnd/license)](https://packagist.org/packages/povils/phpmnd) -[![Build Status](https://travis-ci.org/povils/phpmnd.svg?branch=master)](https://travis-ci.org/povils/phpmnd) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/povils/phpmnd?svg=true)](https://ci.appveyor.com/project/povils/phpmnd) +[![CI](https://github.com/povils/phpmnd/workflows/CI/badge.svg?branch=master)](https://github.com/povils/phpmnd) `phpmnd` is a tool that aims to **help** you to detect magic numbers in your PHP code. By default 0 and 1 are not considered to be magic numbers. @@ -77,7 +76,7 @@ $ export PATH="$PATH:$HOME/.composer/vendor/bin" ## Usage Example -Demo: +Demo: ![demo](./demo.gif) Basic usage: diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 00c98ef..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,52 +0,0 @@ -build: false -platform: - - x64 -clone_folder: c:\projects\workspace - -environment: - matrix: - - dependencies: highest - php_ver_target: 7.4 - - dependencies: highest - php_ver_target: 7.3 - - dependencies: highest - php_ver_target: 7.2 - - dependencies: highest - php_ver_target: 7.1 - -cache: # cache is cleared when linked file is modified - - '%LOCALAPPDATA%\Composer\files -> composer.lock' - - composer.phar - - C:\ProgramData\chocolatey\bin -> appveyor.yml - - C:\ProgramData\chocolatey\lib -> appveyor.yml - - c:\tools\php -> appveyor.yml - -init: - - SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH% - - SET PHP=1 - - SET ANSICON=121x90 (121x90) - - SET COMPOSER_NO_INTERACTION=1 - -install: - - IF EXIST c:\tools\php (SET PHP=0) - # Enable Windows update service - - ps: Set-Service wuauserv -StartupType Manual - # Install PHP - - ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') - - cd c:\tools\php - - IF %PHP%==1 copy php.ini-production php.ini /Y - - IF %PHP%==1 echo date.timezone="UTC" >> php.ini - - IF %PHP%==1 echo extension_dir=ext >> php.ini - - IF %PHP%==1 echo extension=php_openssl.dll >> php.ini - - IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini - - IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat - # Install composer and update per matrix - - appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar - - cd c:\projects\workspace - - IF %dependencies%==lowest appveyor-retry composer update --no-suggest --prefer-dist --prefer-lowest - - IF %dependencies%==highest appveyor-retry composer update --no-suggest --prefer-dist - - composer show - -test_script: - - cd c:\projects\workspace - - vendor\bin\phpunit