diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ffe334e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,14 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.php text eol=lf +*.md text eol=lf + +# Declare files that will always have CRLF line endings on checkout. +#*.sln text eol=crlf + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..dcf5d61 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: CI + +on: [ push ] + +jobs: + build: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest, windows-latest, macOS-latest] + php-versions: [ '7.1', '7.2', '7.3', '7.4' ] + name: PHP ${{ matrix.php-versions }} ${{ matrix.operating-system }} + steps: + - name: Git Configure + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - name: Checkout code + uses: actions/checkout@v2 + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: intl #optional + ini-values: "post_max_size=256M" #optional + - name: Prepare FS + run: mkdir -p build/logs + - name: Validate composer.json and composer.lock + run: composer validate + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest --no-interaction + - name: PHPUnit + run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml + - name: PHPCS + run: vendor/bin/phpcs --standard=psr2 src/ -n + coverage: + name: Coverage Reports + runs-on: ubuntu-latest + continue-on-error: true + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + extensions: intl #optional + ini-values: "post_max_size=256M" #optional + - name: Prepare FS + run: mkdir -p build/logs + - name: Validate composer.json and composer.lock + run: composer validate + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest --no-interaction + - name: PHPUnit + run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml + - name: Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + composer global require php-coveralls/php-coveralls + php-coveralls --coverage_clover=build/logs/clover.xml -v + - name: CodeClimate + uses: paambaati/codeclimate-action@v2.7.5 + env: + CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} + with: + coverageLocations: | + ${{github.workspace}}/build/logs/clover.xml:clover diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d4b26a1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: php - -env: - global: - - CC_TEST_REPORTER_ID=7e798e45a94f35d7d9f99f34b8de5d41694eff3f89681b03acd908191efe3e28 - -php: -- 7.1 -- 7.2 -- 7.3 -- 7.4 - -install: -- travis_retry composer install --no-interaction --prefer-source -- composer require --dev php-coveralls/php-coveralls - -before_script: - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build - -script: -- mkdir -p build/logs -- vendor/bin/phpunit --coverage-clover build/logs/clover.xml -- vendor/bin/phpcs --standard=psr2 src/ -n - -matrix: - fast_finish: true - -after_success: -- travis_retry php vendor/bin/php-coveralls -v - -after_script: - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT