-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
40 lines (39 loc) · 1.11 KB
/
action.yml
File metadata and controls
40 lines (39 loc) · 1.11 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
# .github/workflows/reusable.yml
name: PHP Composer package testing action
description: GitHub CI Action to simplify the process of testing composer packages for PHP.
branding:
icon: 'aperture'
color: 'green'
inputs:
php-version:
required: true
type: string
prefer-lowest:
required: true
type: string
runs:
using: "composite"
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
- name: Validate composer.json and composer.lock
run: composer validate --strict
shell: bash
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v5
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ inputs.php-version }}
- name: Install dependencies
run: |
if [ "${{ inputs.prefer-lowest }}" = "1" ]; then
composer update --prefer-lowest --prefer-dist --no-progress
else
composer install --prefer-dist --no-progress
fi
shell: bash