-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert Travis CI to GitHub Actions (#446)
- Loading branch information
1 parent
dc4f726
commit a1440ca
Showing
5 changed files
with
89 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
phpUnitTests: | ||
runs-on: ubuntu-latest | ||
name: Unit Tests / PHP ${{ matrix.phpVersions }} | ||
strategy: | ||
max-parallel: 6 | ||
matrix: | ||
phpVersions: ['7.2', '7.3', '7.4'] | ||
fail-fast: false | ||
env: | ||
phpExtensions: mbstring, intl, gd, xml, sqlite | ||
cacheKey: ext-cache-v1 | ||
octoberCmsRelease: develop | ||
steps: | ||
- name: Checkout changes | ||
uses: actions/checkout@v2 | ||
with: | ||
path: user-plugin | ||
|
||
- name: Setup cache environment | ||
id: extcache | ||
uses: shivammathur/cache-extensions@v1 | ||
with: | ||
php-version: ${{ matrix.phpVersions }} | ||
extensions: ${{ env.phpExtensions }} | ||
key: ${{ env.cacheKey }} | ||
|
||
- name: Cache extensions | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.extcache.outputs.dir }} | ||
key: ${{ steps.extcache.outputs.key }} | ||
restore-keys: ${{ steps.extcache.outputs.key }} | ||
|
||
- name: Install PHP and extensions | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.phpVersions }} | ||
extensions: ${{ env.phpExtensions }} | ||
tools: composer | ||
coverage: none | ||
|
||
- name: Install October CMS | ||
run: | | ||
wget https://github.com/octobercms/october/archive/${{ env.octoberCmsRelease }}.zip | ||
unzip ${{ env.octoberCmsRelease }}.zip | ||
shopt -s dotglob | ||
mv october-${{ env.octoberCmsRelease }}/* ./ | ||
shopt -u dotglob | ||
cp config/cms.php config/testing/cms.php | ||
mkdir -p plugins/rainlab | ||
mv user-plugin plugins/rainlab/user | ||
- name: Get Composer cache directory | ||
id: composercache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composercache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install Composer dependencies | ||
run: composer install --no-interaction --no-progress --no-suggest | ||
|
||
- name: Run linting | ||
run: ./vendor/bin/parallel-lint plugins/rainlab/user | ||
|
||
- name: Run unit tests | ||
run: | | ||
cd plugins/rainlab/user | ||
../../../vendor/bin/phpunit |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
class AuthFacadeTest extends PluginTestCase | ||
{ | ||
public function test_registering_a_user() | ||
public function testRegisteringAUser() | ||
{ | ||
// register a user | ||
$user = Auth::register([ | ||
|
@@ -26,7 +26,7 @@ public function test_registering_a_user() | |
$this->assertEquals('[email protected]', $user->email); | ||
} | ||
|
||
public function test_registering_a_user_with_auto_activation() | ||
public function testRegisteringAUserWithAutoActivation() | ||
{ | ||
// register a user with the auto-activate flag | ||
$user = Auth::register([ | ||
|
@@ -43,7 +43,7 @@ public function test_registering_a_user_with_auto_activation() | |
$this->assertTrue(Auth::check()); | ||
} | ||
|
||
public function test_registering_a_guest() | ||
public function testRegisteringAGuest() | ||
{ | ||
// register a guest | ||
$guest = Auth::registerGuest(['email' => '[email protected]']); | ||
|
@@ -57,7 +57,7 @@ public function test_registering_a_guest() | |
$this->assertEquals('[email protected]', $guest->email); | ||
} | ||
|
||
public function test_login_and_checking_authentication() | ||
public function testLoginAndCheckingAuthentication() | ||
{ | ||
// we should not be authenticated | ||
$this->assertFalse(Auth::check()); | ||
|