From a85288d34b942a2072c021e6b85305f9886afe59 Mon Sep 17 00:00:00 2001 From: Ne-Lexa Date: Tue, 23 Feb 2021 15:54:47 +0300 Subject: [PATCH] added build on macos --- .github/workflows/build.yml | 25 ++++++++++++++++++------- tests/ZipTestCase.php | 6 ++---- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f76e480..354c55a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,7 @@ jobs: os: - ubuntu-latest - windows-latest + - macos-latest php: - '7.4' - '8.0' @@ -35,6 +36,16 @@ jobs: if: matrix.os == 'ubuntu-latest' 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 uses: shivammathur/setup-php@v2 @@ -46,20 +57,20 @@ jobs: tools: composer:v2 - - name: Determine composer cache directory on Linux - if: matrix.os == 'ubuntu-latest' + name: Determine composer cache directory on Linux or MacOS + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' 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 if: matrix.os == 'windows-latest' 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 uses: actions/cache@v2 diff --git a/tests/ZipTestCase.php b/tests/ZipTestCase.php index b0d7437..44fa573 100644 --- a/tests/ZipTestCase.php +++ b/tests/ZipTestCase.php @@ -26,8 +26,6 @@ abstract class ZipTestCase extends TestCase /** * Before test. - * - * @noinspection PhpMissingParentCallCommonInspection */ protected function setUp(): void { @@ -48,11 +46,11 @@ abstract class ZipTestCase extends TestCase { parent::tearDown(); - if ($this->outputFilename !== null && file_exists($this->outputFilename)) { + if (file_exists($this->outputFilename)) { unlink($this->outputFilename); } - if ($this->outputDirname !== null && is_dir($this->outputDirname)) { + if (is_dir($this->outputDirname)) { FilesUtil::removeDir($this->outputDirname); } }