diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..686b094bd19ae5d8eb6e05d07a31d6539d001604 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,52 @@ +name: PHP CI + +on: + push: + pull_request: + +defaults: + run: + shell: bash + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + +# - name: Configure sysctl limits +# run: | +# # sudo swapoff -a +# sudo sysctl -w vm.swappiness=1 +# sudo sysctl -w fs.file-max=262144 +# sudo sysctl -w vm.max_map_count=262144 + +# - name: Runs Elasticsearch +# uses: elastic/elastic-github-actions/elasticsearch@master +# with: +# stack-version: 8.9.0 + + - name: Install composer and dependencies + uses: php-actions/composer@v6 + + - name: PHPUnit Tests + uses: php-actions/phpunit@v3 + env: + XDEBUG_MODE: coverage + with: + bootstrap: vendor/autoload.php + configuration: phpunit.xml.dist + php_extensions: xdebug + args: tests --coverage-clover ./coverage.xml + + - name: Upload to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + files: ./coverage.xml + verbose: true + + - name: Run PHP CodeSniffer + run: vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor/ ./ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c8934ae1c8c05dbff79dbc0bd95dee15839a51bf..0000000000000000000000000000000000000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -sudo: false -language: php -php: - - 8.1 -env: - global: - - ES_VERSION=8.9.0 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz -install: - - wget ${ES_DOWNLOAD_URL} - - tar -xzf elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz - - ./elasticsearch-${ES_VERSION}/bin/elasticsearch -d -before_script: - - if [ "$GITHUB_COMPOSER_AUTH" ]; then composer config -g github-oauth.github.com $GITHUB_COMPOSER_AUTH; fi - - composer install --no-interaction --prefer-dist -script: - - wget -q --waitretry=1 --retry-connrefused -T 10 -O - http://127.0.0.1:9200 - - vendor/bin/phpunit --coverage-clover=coverage.xml - - vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor/ ./ -after_script: - - travis_retry bash <(curl -s https://codecov.io/bash)