-
-
Notifications
You must be signed in to change notification settings - Fork 6
48 lines (44 loc) · 1.58 KB
/
validate.yml
File metadata and controls
48 lines (44 loc) · 1.58 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
name: "Validate"
on:
push:
paths: [ 'modules/**' ]
branches: [ '6.x' ]
tags: [ 'v*' ]
pull_request:
paths: [ 'modules/**' ]
permissions: {}
jobs:
linting:
name: "Linting (PHP ${{ matrix.php-versions }})"
runs-on: "ubuntu-latest"
strategy:
matrix:
php-versions: [ '8.0', '8.1' ]
steps:
- name: "Checkout"
uses: "actions/checkout@c2d88d3ecc89a9ef08eebf45d9637801dcee7eb5" # v6.0.0
with:
persist-credentials: false
- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2.36.0
with:
php-version: "${{ matrix.php-versions }}"
extensions: "mbstring, xml, ctype, iconv, intl, gd"
tools: "composer:v2"
- name: "Get composer cache directory"
id: "composer-cache"
run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'
- name: "Cache composer dependencies"
uses: "actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb" # v5.0.1
with:
path: "${{ steps.composer-cache.outputs.dir }}"
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: "${{ runner.os }}-composer-"
lookup-only: true
- name: "Validate composer"
run: "composer validate"
- name: "Install Composer dependencies"
run: "composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader"
# Ensure our code looks proper
- name: "Lint the code"
run: "make lint"