-
Notifications
You must be signed in to change notification settings - Fork 7
75 lines (58 loc) · 1.93 KB
/
test.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Tests
on: push
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: [ '7.4', '7.1', '7.0' ]
include:
- php-versions: '8.1'
- php-versions: '8.0'
- php-versions: '5.6'
- php-versions: '5.5'
build-assets: 1
steps:
- uses: actions/checkout@v3
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.php-versions }}
- name: Install dependencies
run: composer update --prefer-dist --no-progress
- name: Install Test Environment
run: composer run install-test-env
- name: Validate PHP syntax Part 1
# The usage of bash + || exit 1 is to ensure xargs does not exit on first error.
run: find ./ -maxdepth 1 -name '*.php' | xargs -n1 bash -c 'php -lf $0 || exit 1'
- name: Validate PHP syntax Part 2
# The usage of bash + || exit 1 is to ensure xargs does not exit on first error.
run: find app/ views/ \( -name '*.php' \) | xargs -n1 bash -c 'php -lf $0 || exit 1'
- name: Install Node.js
if: ${{ matrix.build-assets }}
uses: actions/setup-node@v2
with:
node-version: 12.13
- name: Install Yarn
if: ${{ matrix.build-assets }}
run: npm install -g yarn
- name: Install Node dependencies
if: ${{ matrix.build-assets }}
run: yarn install
- name: Build assets
if: ${{ matrix.build-assets }}
run: yarn build
- name: Lint assets
if: ${{ matrix.build-assets }}
run: yarn lint