forked from vufind-org/vufind
-
Notifications
You must be signed in to change notification settings - Fork 3
87 lines (73 loc) · 2.66 KB
/
ci.yaml
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
76
77
78
79
80
81
82
83
84
85
86
87
name: CI
on: [push, pull_request]
jobs:
run-tests:
name: Tests with PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
env:
VUFIND_HOME: $GITHUB_WORKSPACE
VUFIND_LOCAL_DIR: $GITHUB_WORKSPACE/local
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1']
# We run most tests on all platforms, but we only run Javascript-related tests in 8.1.
# Since the results should be the same on all platforms, we don't need to repeat them.
include:
- php-version: 7.4
phing_tasks: "qa-php"
- php-version: 8.0
phing_tasks: "qa-php"
- php-version: 8.1
phing_tasks: "qa-console"
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: intl, xsl
tools: composer:2.1.6
ini-values: error_reporting=E_ALL
- name: Checkout
uses: actions/checkout@v3
- name: Disable Solr installation
run: touch solr/.disableAutomaticInstall
- name: Setup node
if: ${{ matrix.phing_tasks == 'qa-console' }}
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Cache NPM dependencies
if: ${{ matrix.phing_tasks == 'qa-console' }}
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install node dependencies
if: ${{ matrix.phing_tasks == 'qa-console' }}
run: npm install --ignore-scripts
- 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@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Cache php-cs-fixer data
uses: actions/cache@v3
with:
path: .php_cs_cache
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ github.sha }}"
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-"
- name: Cache phpstan data
uses: actions/cache@v3
with:
path: .phpstan_cache
key: "php-${{ matrix.php-version }}-phpstan-${{ github.sha }}"
restore-keys: "php-${{ matrix.php-version }}-phpstan-"
- name: Install composer dependencies
run: composer install
- name: Run tests
run: vendor/bin/phing ${{ matrix.phing_tasks }}