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 phpcs and phpstan result cache in github actions #763

Open
wants to merge 5 commits into
base: 3.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 34 additions & 6 deletions .github/workflows/deliver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,51 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Restore farmOS dev Docker image from cache
uses: actions/cache@v3
with:
path: /tmp/farmos-dev.tar
key: farmos-dev-${{ github.run_id }}
- name: Load farmos/farmos:3.x-dev image
run: docker load < /tmp/farmos-dev.tar
- name: Create cache directory
run: mkdir -p ./cache
- name: Load phpcs and phpstan cache
uses: actions/cache/restore@v3
with:
path: |
./cache/.phpcs.cache.farmos
./cache/.phpcs.cache.contrib
./cache/resultCache.php
key: phpcs-phpstan-${{ hashFiles('./cache/.phpcs.cache.farmos', './cache/.phpcs.cache.contrib', './cache/resultCache.php') }}
restore-keys: phpcs-phpstan-
- name: Run PHP CodeSniffer
run: docker run farmos/farmos:3.x-dev phpcs /opt/drupal/web/profiles/farm
run: |
docker run \
-v ./cache:/tmp/phpcs \
farmos/farmos:3.x-dev \
phpcs --cache=/tmp/phpcs/.phpcs.cache.farmos --parallel=$(nproc) /opt/drupal/web/profiles/farm
- name: Run PHPStan
run: docker run farmos/farmos:3.x-dev phpstan analyze --memory-limit 1G /opt/drupal/web/profiles/farm
run: |
docker run \
-v ./cache:/tmp/phpstan \
farmos/farmos:3.x-dev \
phpstan -vvv analyze --memory-limit 1G /opt/drupal/web/profiles/farm
- name: Check PHP compatibility of contrib modules and themes (ignore warnings).
run: |
docker run farmos/farmos:3.x-dev phpcs --standard=PHPCompatibility --runtime-set testVersion 8.2- --warning-severity=0 /opt/drupal/web/modules
docker run farmos/farmos:3.x-dev phpcs --standard=PHPCompatibility --runtime-set testVersion 8.2- --warning-severity=0 /opt/drupal/web/themes
docker run \
-v ./cache:/tmp/phpcs \
farmos/farmos:3.x-dev \
phpcs --cache=/tmp/phpcs/.phpcs.cache.contrib --parallel=$(nproc) --standard=PHPCompatibility --runtime-set testVersion 8.2- --warning-severity=0 /opt/drupal/web/modules /opt/drupal/web/themes
- name: Save phpcs and phpstan cache
uses: actions/cache/save@v3
with:
path: |
./cache/.phpcs.cache.farmos
./cache/.phpcs.cache.contrib
./cache/resultCache.php
key: phpcs-phpstan-${{ hashFiles('./cache/.phpcs.cache.farmos', './cache/.phpcs.cache.contrib', './cache/resultCache.php') }}

test:
name: Run PHPUnit tests
runs-on: ubuntu-latest
Expand Down