Skip to content

Commit

Permalink
Add GH Actions build for static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraM committed Nov 28, 2020
1 parent 2628812 commit c39550a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Tests and linting

on:
push:
pull_request:
schedule:
- cron: '0 3 * * *'

jobs:
codestyle:
name: "Code style and static analysis"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: mbstring, intl
tools: composer:v2

- name: Install dependencies
run: composer update --no-progress

- name: Lint
run: composer lint

- name: Run checks
run: composer analyze

markdown-link-check:
name: "Markdown link check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: 'yes'
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ matrix:
before_script: ~
script:
- composer lint
- composer codestyle:check
- composer analyze
after_success: ~

Expand Down
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,13 @@
"all": [
"@lint",
"@analyze",
"@codestyle:check",
"@test"
],
"analyze": [
"vendor/bin/ecs check src/ src-tests/ --ansi",
"vendor/bin/phpstan analyze -c phpstan.neon --ansi"
],
"codestyle:check": [
"vendor/bin/ecs check src/ src-tests/ --ansi"
],
"codestyle:fix": [
"fix": [
"@composer normalize",
"vendor/bin/ecs check src/ src-tests/ --ansi --fix"
],
Expand Down

0 comments on commit c39550a

Please sign in to comment.