-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (76 loc) · 3.15 KB
/
unit-test-and-release.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
85
86
87
88
89
90
91
92
93
name: Test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.1', '8.2']
wp-versions: ['6.3', '6.4']
name: PHP ${{ matrix.php-versions }} / WP ${{ matrix.wp-versions }} Test on ${{ matrix.operating-system }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: '20'
- name: npm install
run: npm ci
- name: Build
run: |
bash ./bin/build.sh
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl #optional, setup extensions
ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
- name: Composer install
run: composer install --optimize-autoloader --prefer-dist
- name: Install WordPress
run: |
chmod -R 767 ./ # TODO: Possibly integrate in wp-env
WP_ENV_CORE=WordPress/WordPress#${{ matrix.wp-versions }} WP_ENV_PHP_VERSION=${{ matrix.php-versions }} npm run wp-env start
npm run wp-env run cli wp core version
npm run wp-env run cli wp cli info
- name: Running lint check
run: npm run lint-php
- name: Running single site unit tests
run: npm run test-unit-php
if: ${{ success() || failure() }}
release:
name: Release
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v3
if: contains(github.ref, 'tags/')
- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: '14'
if: contains(github.ref, 'tags/')
- name: npm install
run: npm ci
if: contains(github.ref, 'tags/')
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mbstring, intl #optional, setup extensions
ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
coverage: xdebug #optional, setup coverage driver
if: contains(github.ref, 'tags/')
- name: Composer install
run: composer install --optimize-autoloader --prefer-dist --no-dev
if: contains(github.ref, 'tags/')
- name: Build
run: |
bash ./bin/build.sh
if: contains(github.ref, 'tags/')
- name: WordPress Plugin Deploy
if: contains(github.ref, 'tags/')
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: schedule-terms