Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GH actions #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test

on:
push:
branches:
- master
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
test:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['8.0']
phpunit: ['latest']
include:
- php: '7.2'
phpunit: '8.5.13'
- php: '7.3'
phpunit: '8.5.13'
- php: '7.4'
phpunit: '8.5.13'
coverage: xdebug
flags: '--coverage-clover clover.xml'
# - php: '8.1'
# experimental: true


steps:
- uses: actions/checkout@v2

- name: Use PHP ${{ matrix.php }}
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php }}
tools: phpunit:${{ matrix.phpunit }}
coverage: ${{ matrix.coverage }}

- name: Install
run: composer install

- name: Test
run: phpunit --configuration phpunit.xml.dist ${{ matrix.flags }}
52 changes: 0 additions & 52 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"yourls-plugin"
],
"require": {
"composer-plugin-api": "^1.0",
"wikimedia/composer-merge-plugin": "^1.4",
"composer-plugin-api": "^2.0",
"wikimedia/composer-merge-plugin": "^2.0",
"symfony/thanks": "^1.2"
},
"require-dev": {
"composer/composer": "^2.0.13",
"phpunit/phpunit": "^7.0"
"phpunit/phpunit": "^8.5"
},
"autoload": {
"psr-4": {
Expand Down
27 changes: 27 additions & 0 deletions src/ComposerInstaller/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,31 @@ public function getCapabilities()
);
}

/**
* Remove any hooks from Composer
*
* @codeCoverageIgnore
*
* @param \Composer\Composer $composer
* @param \Composer\IO\IOInterface $io
* @return void
*/
public function deactivate(Composer $composer, IOInterface $io)
{
// nothing to do
}

/**
* Prepare the plugin to be uninstalled
*
* @codeCoverageIgnore
*
* @param Composer $composer
* @param IOInterface $io
* @return void
*/
public function uninstall(Composer $composer, IOInterface $io)
{
// nothing to do
}
}
2 changes: 1 addition & 1 deletion tests/ComposerInstaller/MockDownloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function getInstallationSource()
return 'dist';
}

public function download(PackageInterface $package, $path)
public function download(PackageInterface $package, $path, ?$prevPackage = NULL)
{
// install a fake plugin directory
$this->filesystem->ensureDirectoryExists($path);
Expand Down