Skip to content

Commit

Permalink
Add GitHub actions support for 'master' branch (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidGoodwin authored Jul 2, 2021
1 parent 17dc560 commit f069c2c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on: push

name: GitHub Action
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4' ]
phpunit-versions: ['latest']

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: phpunit
run: composer test

3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"php": ">=5.3.0",
"ext-xmlwriter": "*"
},
"scripts": {
"test" : "@php vendor/bin/phpunit tests"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/IndexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testWritingFileGzipped()

$this->assertTrue(file_exists($fileName));
$finfo = new \finfo(FILEINFO_MIME_TYPE);
$this->assertEquals('application/x-gzip', $finfo->file($fileName));
$this->assertRegExp('!application/(x-)?gzip!', $finfo->file($fileName));
$this->assertIsValidIndex('compress.zlib://' . $fileName);
unlink($fileName);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/SitemapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function testWritingFileGzipped()

$this->assertTrue(file_exists($fileName));
$finfo = new \finfo(FILEINFO_MIME_TYPE);
$this->assertEquals('application/x-gzip', $finfo->file($fileName));
$this->assertRegExp('!application/(x-)?gzip!', $finfo->file($fileName));
$this->assertIsValidSitemap('compress.zlib://' . $fileName);
$this->assertIsOneMemberGzipFile($fileName);

Expand Down Expand Up @@ -230,7 +230,7 @@ public function testMultipleFilesGzipped()
$finfo = new \finfo(FILEINFO_MIME_TYPE);
foreach ($expectedFiles as $expectedFile) {
$this->assertTrue(file_exists($expectedFile), "$expectedFile does not exist!");
$this->assertEquals('application/x-gzip', $finfo->file($expectedFile));
$this->assertRegExp('!application/(x-)?gzip!', $finfo->file($expectedFile));
$this->assertIsValidSitemap('compress.zlib://' . $expectedFile);
$this->assertIsOneMemberGzipFile($expectedFile);
unlink($expectedFile);
Expand Down

0 comments on commit f069c2c

Please sign in to comment.