-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (73 loc) · 3.11 KB
/
tests.yml
File metadata and controls
84 lines (73 loc) · 3.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
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
---
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
phpUnitTests:
runs-on: ubuntu-latest
name: Unit Tests / PHP ${{ matrix.phpVersion }} / Winter ${{ matrix.winterRelease }}
strategy:
max-parallel: 6
matrix:
phpVersion: ['8.1', '8.2', '8.3']
winterRelease: ['develop']
winterReleaseDir: ['develop']
fail-fast: false
env:
phpExtensions: mbstring, intl, gd, xml, sqlite
cacheKey: ext-cache-v1
winterCmsRelease: develop
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout changes
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Move files to a syncops-plugin directory
run: mkdir syncops-plugin && find . -mindepth 1 -maxdepth 1 ! -name 'syncops-plugin' -exec mv -t syncops-plugin -- {} +
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.phpVersion }}
extensions: ${{ env.phpExtensions }}
key: ${{ env.cacheKey }}
- name: Cache extensions
uses: actions/cache@v4
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Install PHP and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.phpVersion }}
extensions: ${{ env.phpExtensions }}
- name: Install Winter CMS
run: |
wget https://github.com/wintercms/winter/archive/${{ matrix.winterRelease }}.zip
unzip ${{ matrix.winterRelease }}.zip
rm ${{ matrix.winterRelease }}.zip
shopt -s dotglob
mv winter-${{ matrix.winterReleaseDir }}/* ./
rmdir winter-${{ matrix.winterReleaseDir }}
shopt -u dotglob
cp config/cms.php config/testing/cms.php
mkdir -p plugins/numencode
mv syncops-plugin plugins/numencode/syncops
- name: Get Composer cache directory
id: composercache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_ENV
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ env.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist
- name: Run unit tests
run: php artisan winter:test -p NumenCode.SyncOps --configuration=plugins/numencode/syncops/phpunit.xml