Skip to content

Commit

Permalink
run static analysis in a Docker container instead
Browse files Browse the repository at this point in the history
Signed-off-by: Demin Yin <deminy@deminy.net>
  • Loading branch information
deminy committed Dec 13, 2023
1 parent 14b15b3 commit 8f706e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
31 changes: 10 additions & 21 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,21 @@ on: [ push, pull_request, workflow_dispatch ]
jobs:
static-analysis:
runs-on: ubuntu-22.04
container:
image: deminy/swoole-by-examples:server-5.1

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: composer:v2
extensions: redis-stable, swoole-5.1.1, sysvmsg
ini-values: swoole.enable_library=off
coverage: none
env:
SWOOLE_CONFIGURE_OPTS: --enable-mysqlnd --enable-swoole-pgsql --enable-openssl --enable-sockets --enable-swoole-curl

- name: Install PHPStan
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: |
set -ex
composer global require phpstan/phpstan=^1.11.x-dev -n -q --no-progress
composer global require predis/predis=~2.2 -n -q --no-progress
composer global require swoole/library=~5.0 -n -q --no-progress
- name: Setup PHP And Swoole
run: |
set -e
echo "swoole.enable_library=Off" >> /usr/local/etc/php/conf.d/docker-php-ext-swoole.ini
composer global require -n -q --no-progress -- \
phpstan/phpstan=^1.11.x-dev \
predis/predis=~2.2 \
swoole/library=~5.0
- name: Run Static Analysis
run: ~/.composer/vendor/bin/phpstan analyse --no-progress --memory-limit 2G
1 change: 0 additions & 1 deletion examples/pool/process-pool/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
}
});
}
return;

// This second example shows how to send messages (and deploy tasks) to a process pool through TCP socket.
go(function () use ($settings) {
Expand Down

0 comments on commit 8f706e3

Please sign in to comment.