diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3c72c05 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +* text=auto + +# Path-based git attributes +# https://git-scm.com/docs/gitattributes + +# Ignore all test and documentation with "export-ignore". +/.gitattributes export-ignore +/.github export-ignore +/.gitignore export-ignore +/example.php export-ignore +/phpunit.xml.dist export-ignore +/tests export-ignore diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..916246e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,45 @@ +name: Tests + +on: ['push', 'pull_request'] + +jobs: + ci: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + php: ['7.3', '7.4', '8.0', '8.1'] + + name: PHP ${{ matrix.php }} - ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer + coverage: none + + - name: Setup Tor + uses: tor-actions/setup-tor@main + with: + tor-version: '0.4.6-rc7' + stable: true + daemon: true + config: | + ControlPort 9051 + CookieAuthentication 0 + + - name: Setup Problem Matches + run: | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Install PHP dependencies + run: composer install --no-interaction --no-progress --ansi + + - name: Unit Tests + run: vendor/bin/phpunit --colors=always diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9cef9b4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: php -php: - - '7.3' - - '8.0' - -before_install: - - sudo apt-get install -y tor - - sudo sh -c 'echo "ControlPort 9051" >> /etc/tor/torrc' - - sudo sh -c 'echo "CookieAuthentication 0" >> /etc/tor/torrc' - - sudo service tor restart - -install: - - composer install diff --git a/README.md b/README.md index ea9ed79..578102e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # GuzzleTor -[![Build Status](https://travis-ci.org/megahertz/guzzle-tor.svg?branch=master)](https://travis-ci.org/megahertz/guzzle-tor) + +[![Build Status](https://img.shields.io/github/workflow/status/megahertz/guzzle-tor/Tests.svg?style=flat-square)](https://github.com/megahertz/guzzle-tor/actions) This [Guzzle](https://github.com/guzzle/guzzle) middleware allows to use Tor client as a proxy