From 2f73945f8f9ab0c80f4fa0fd2a654156145337f3 Mon Sep 17 00:00:00 2001 From: Jamie Schouten Date: Wed, 29 Jan 2025 19:14:27 +0000 Subject: [PATCH] Add more caching (#2) Reviewed-on: https://git.qlic.nl/workflows/quality/pulls/2 --- .gitea/workflows/quality.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/quality.yml b/.gitea/workflows/quality.yml index 5be7a96..9442c7a 100644 --- a/.gitea/workflows/quality.yml +++ b/.gitea/workflows/quality.yml @@ -9,10 +9,10 @@ on: required: false type: string default: ${{ vars.REGISTRY_PASSWORD }} - environment_path: + environment-path: required: false type: string - default: .env.phpstan + default: .env.example jobs: quality: @@ -26,10 +26,22 @@ jobs: - name: Setup composer uses: https://git.qlic.nl/actions/setup-composer@v1 - - name: Copy ${{ inputs.environment_path }} to .env if it exists + - name: Cache PHPStan + uses: actions/cache@v4 + with: + path: .phpstan + key: phpstan-${{ hashFiles('composer.lock', 'phpstan.dist.neon') }} + + - name: Cache PHP CS Fixer + uses: actions/cache@v4 + with: + path: .php-cs-fixer.cache + key: phpcs-${{ hashFiles('composer.lock', '.php-cs-fixer.dist.php') }} + + - name: Copy ${{ inputs.environment-path }} to .env if it exists run: | - if [ -f ${{ inputs.environment_path }} ]; then - cp ${{ inputs.environment_path }} .env + if [ -f ${{ inputs.environment-path }} ]; then + cp ${{ inputs.environment-path }} .env fi - name: Run PHPStan @@ -39,4 +51,4 @@ jobs: run: ./vendor/bin/php-cs-fixer fix --diff --dry-run - name: Run audit - run: composer audit \ No newline at end of file + run: composer audit