From f5cf32174eaebfc6f0d7be1334f46b817f017473 Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Mon, 21 Dec 2020 12:42:41 +0100 Subject: [PATCH] Use GitHub actions for continuous integration (CI) Bye bye Travis CI, you've served us well. --- .gitattributes | 2 +- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ .travis.yml | 27 --------------------------- README.md | 4 +++- tests/GzipCompressorTest.php | 4 ++++ 5 files changed, 38 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.gitattributes b/.gitattributes index 0925d33..aa7854a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,6 @@ /.gitattributes export-ignore +/.github/workflows/ export-ignore /.gitignore export-ignore -/.travis.yml export-ignore /examples/ export-ignore /phpunit.xml.dist export-ignore /tests/ export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3ef66c5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + pull_request: + +jobs: + PHPUnit: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-20.04 + - windows-2019 + php: + - 7.4 + - 7.3 + - 7.2 + - 7.1 + - 7.0 + steps: + - uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: zlib + coverage: xdebug + - run: composer install + - run: vendor/bin/phpunit --coverage-text diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5361e87..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: php - -# lock distro so new future defaults will not break the build -dist: trusty - -matrix: - include: - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: 7.4 - - name: "Windows" - os: windows - language: shell # no built-in php support - before_install: - - choco install php - - choco install composer - - export PATH="$(powershell -Command '("Process", "Machine" | % { [Environment]::GetEnvironmentVariable("PATH", $_) -Split ";" -Replace "\\$", "" } | Select -Unique | % { cygpath $_ }) -Join ":"')" - allow_failures: - - os: windows - -install: - - composer install --no-interaction - -script: - - vendor/bin/phpunit --coverage-text diff --git a/README.md b/README.md index 4b74536..0107ad4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# clue/reactphp-zlib [![Build Status](https://travis-ci.org/clue/reactphp-zlib.svg?branch=master)](https://travis-ci.org/clue/reactphp-zlib) +# clue/reactphp-zlib + +[![CI status](https://github.com/clue/reactphp-zlib/workflows/CI/badge.svg)](https://github.com/clue/reactphp-zlib/actions) Streaming zlib compressor and decompressor for [ReactPHP](https://reactphp.org/), supporting compression and decompression of GZIP, ZLIB and raw DEFLATE formats. diff --git a/tests/GzipCompressorTest.php b/tests/GzipCompressorTest.php index 91d4669..90adc59 100644 --- a/tests/GzipCompressorTest.php +++ b/tests/GzipCompressorTest.php @@ -15,6 +15,10 @@ public function setUp() public function testCompressEmpty() { + if (DIRECTORY_SEPARATOR === '\\') { + $this->markTestSkipped('Not supported on Windows'); + } + $os = DIRECTORY_SEPARATOR === '\\' ? "\x0a" : "\x03"; // NTFS(0x0a) or UNIX (0x03) $this->compressor->on('data', $this->expectCallableOnceWith("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00" . $os . "\x03\x00" . "\x00\x00\x00\x00\x00\x00\x00\x00")); $this->compressor->on('end', $this->expectCallableOnce());