-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathaction.yml
More file actions
50 lines (46 loc) · 1.56 KB
/
Copy pathaction.yml
File metadata and controls
50 lines (46 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: "Setup PHP with Cached Composer"
description: "Setup PHP and install Composer dependencies with caching"
inputs:
php-version:
description: "PHP version to setup"
required: false
default: "7.4"
working-directory:
description: "Working directory for composer install"
required: true
composer-options:
description: "Additional composer options"
required: false
default: "--no-progress --optimize-autoloader"
tools:
description: "Tools to install with PHP"
required: false
default: "composer:v2"
runs:
using: "composite"
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
tools: ${{ inputs.tools }}
coverage: none
- name: Get Composer cache directory
id: composer-cache
shell: bash
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: |
${{ steps.composer-cache.outputs.dir }}
${{ inputs.working-directory }}/vendor
key: composer-${{ runner.os }}-php${{ inputs.php-version }}-${{ hashFiles(format('{0}/composer.lock', inputs.working-directory)) }}
restore-keys: |
composer-${{ runner.os }}-php${{ inputs.php-version }}-
composer-${{ runner.os }}-
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
working-directory: ${{ inputs.working-directory }}
composer-options: ${{ inputs.composer-options }}