1
0
mirror of https://github.com/Ne-Lexa/php-zip.git synced 2025-07-31 04:30:13 +02:00

added build on macos

This commit is contained in:
Ne-Lexa
2021-02-23 15:54:47 +03:00
parent 620065ac5b
commit a85288d34b
2 changed files with 20 additions and 11 deletions

View File

@@ -19,6 +19,7 @@ jobs:
os: os:
- ubuntu-latest - ubuntu-latest
- windows-latest - windows-latest
- macos-latest
php: php:
- '7.4' - '7.4'
- '8.0' - '8.0'
@@ -35,6 +36,16 @@ jobs:
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install unzip p7zip-full run: sudo apt-get install unzip p7zip-full
-
name: Install windows dependencies
if: matrix.os == 'windows-latest'
run: choco install zip unzip 7zip
-
name: Install macos dependencies
if: matrix.os == 'macos-latest'
run: brew install zip unzip p7zip
- -
name: Install PHP with extensions name: Install PHP with extensions
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
@@ -46,20 +57,20 @@ jobs:
tools: composer:v2 tools: composer:v2
- -
name: Determine composer cache directory on Linux name: Determine composer cache directory on Linux or MacOS
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
-
name: Set coverage args
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.0'
run: echo "PHPUNIT_COVERAGE=1" >> $GITHUB_ENV
- -
name: Determine composer cache directory on Windows name: Determine composer cache directory on Windows
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
-
name: Set coverage args
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.0'
run: echo "PHPUNIT_COVERAGE=1" >> $GITHUB_ENV
- -
name: Cache composer dependencies name: Cache composer dependencies
uses: actions/cache@v2 uses: actions/cache@v2

View File

@@ -26,8 +26,6 @@ abstract class ZipTestCase extends TestCase
/** /**
* Before test. * Before test.
*
* @noinspection PhpMissingParentCallCommonInspection
*/ */
protected function setUp(): void protected function setUp(): void
{ {
@@ -48,11 +46,11 @@ abstract class ZipTestCase extends TestCase
{ {
parent::tearDown(); parent::tearDown();
if ($this->outputFilename !== null && file_exists($this->outputFilename)) { if (file_exists($this->outputFilename)) {
unlink($this->outputFilename); unlink($this->outputFilename);
} }
if ($this->outputDirname !== null && is_dir($this->outputDirname)) { if (is_dir($this->outputDirname)) {
FilesUtil::removeDir($this->outputDirname); FilesUtil::removeDir($this->outputDirname);
} }
} }