Skip to content

Commit

Permalink
Feature/GitHub actions (#1)
Browse files Browse the repository at this point in the history
Add github actions support
  • Loading branch information
johnzuk authored Jan 21, 2021
1 parent 69b1c0a commit 187d767
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Static Analysis

on:
push:
pull_request:

jobs:
composer-validate:
name: Composer Validate
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Validate dependencies
uses: php-actions/composer@v5
with:
command: validate --strict

phpstan:
name: PHPStan
runs-on: ubuntu-latest

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v2
coverage: none

- name: Install Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer install --no-interaction --no-progress

- name: Execute PHPStan
run: vendor/bin/phpstan analyze --no-progress src/
15 changes: 15 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Tests

on:
push:
pull_request:

jobs:
build-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: php-actions/composer@v5
- uses: php-actions/phpunit@v2

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"php": "^7.1 || 8.0",
"php": "^7.1 || ^8.0",
"php-http/client-common": "^2.0",
"php-http/discovery": "^1.6",
"php-http/httplug": "^2.0",
Expand Down

0 comments on commit 187d767

Please sign in to comment.