Skip to content

Commit

Permalink
Use github actions (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm committed Aug 18, 2022
1 parent e5e3039 commit 85e6f04
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 52 deletions.
46 changes: 0 additions & 46 deletions .circleci/config.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,55 @@
name: Test
on:
- push
- pull_request

jobs:
test:
name: Run tests
runs-on: 'ubuntu-20.04'
strategy:
fail-fast: false
matrix:
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
steps:
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJSON(matrix) }}
run: echo "$MATRIX_CONTEXT"

- name: Checkout
uses: actions/checkout@v2

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

- name: Dump composer verson
run: composer --version

- name: Validate composer.json
run: composer --verbose validate

- name: Install dependencies
run: composer --verbose install

- name: Run phpstan
run: composer phpstan

- name: Run tests
run: composer test
env:
COMPOSER_VERSION: ${{ matrix.composer }}

- name: Coveralls
if: matrix.php-version == 7.4
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
php vendor/bin/php-coveralls -v
2 changes: 1 addition & 1 deletion README.md
@@ -1,7 +1,7 @@
# composer-changelog-fetcher

[![Violinist enabled](https://img.shields.io/badge/violinist-enabled-brightgreen.svg)](https://violinist.io)
[![CircleCI](https://circleci.com/gh/violinist-dev/composer-changelog-fetcher.svg?style=svg)](https://circleci.com/gh/violinist-dev/composer-changelog-fetcher)
[![Test](https://github.com/violinist-dev/composer-changelog-fetcher/actions/workflows/test.yml/badge.svg)](https://github.com/violinist-dev/composer-changelog-fetcher/actions/workflows/test.yml)
[![Coverage Status](https://coveralls.io/repos/github/violinist-dev/composer-changelog-fetcher/badge.svg?branch=master)](https://coveralls.io/github/violinist-dev/composer-changelog-fetcher?branch=master)

## Installation
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Expand Up @@ -21,14 +21,15 @@
"violinist-dev/git-log-format": "^1.1.2"
},
"require-dev": {
"phpunit/phpunit": "^6.5",
"phpunit/phpunit": "^7 || ^8 || ^9",
"php-coveralls/php-coveralls": "^2.1",
"squizlabs/php_codesniffer": "^3.4",
"phpstan/phpstan": "^0.9.2",
"phpstan/phpstan-phpunit": "^0.9.4"
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0"
},
"scripts": {
"test": "@composer lint && phpunit && phpstan analyse --level=max -c phpstan.neon src tests",
"phpstan": "phpstan analyse src tests",
"test": "@composer lint && phpunit",
"lint": "./vendor/bin/phpcs -p -n"

}
Expand Down
2 changes: 2 additions & 0 deletions phpstan.neon
@@ -1,2 +1,4 @@
parameters:
level: 5
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
3 changes: 3 additions & 0 deletions src/DependencyRepoRetriever.php
Expand Up @@ -28,6 +28,9 @@ public function retrieveDependencyRepo($data)
if (!isset($data->source) || $data->source->type != 'git') {
throw new \Exception(sprintf('Unknown source or non-git source found for %s. Aborting.', $data->name));
}
if (empty($data->name)) {
throw new \Exception('No package name found');
}
// We could have this cached in the md5 of the package name.
$clone_path = '/tmp/' . md5($data->name);
$repo_path = $data->source->url;
Expand Down
2 changes: 1 addition & 1 deletion src/ProcessFactory.php
Expand Up @@ -18,6 +18,6 @@ class ProcessFactory implements ProcessFactoryInterface
public function getProcess($commandline, $cwd = null, array $env = null, $input = null, $timeout = 60, array $options = null)
{
$process_class = Process::class;
return new $process_class($commandline, $cwd, $env, $timeout, $options);
return new $process_class($commandline, $cwd, $env, $input, $timeout);
}
}

0 comments on commit 85e6f04

Please sign in to comment.