-
Notifications
You must be signed in to change notification settings - Fork 138
84 lines (70 loc) · 2.43 KB
/
main.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
76
77
78
79
80
81
82
83
84
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the develop branch
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
run:
name: PHP ${{ matrix.php-versions }}
runs-on: ubuntu-20.04
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2']
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
ini-values: mysqli.default_socket=/var/run/mysqld/mysqld.sock
tools: composer:v1
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'npm'
- name: Get composer cache directory
id: composer-cache
run: echo "CI_COMPOSER_CACHE_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ${{ env.CI_COMPOSER_CACHE_DIR }}
key: composer-${{ hashFiles('**/composer.lock') }}
restore-keys: composer-
- name: Cache build caches
uses: actions/cache@v3
with:
path: ./build/cache
key: build-cache-${{ github.sha }}
restore-keys: build-cache-
- name: Start MySQL
run: sudo systemctl start mysql.service
- name: Install Node dependencies
run: npm install
- name: Gulp init
run: npx gulp init
- name: Set up database
run: |
mysql -e "create database IF NOT EXISTS omeka_test;" -uroot -proot
sed -i 's/^host.*/host = "localhost"/' application/test/config/database.ini
sed -i 's/^user.*/user = "root"/' application/test/config/database.ini
sed -i 's/^dbname.*/dbname = "omeka_test"/' application/test/config/database.ini
sed -i 's/^password.*/password = "root"/' application/test/config/database.ini
- name: Run tests
run: npx gulp test --continue
env:
PHP_CS_FIXER_IGNORE_ENV: 1