-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (85 loc) · 3.18 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
94
95
96
97
98
99
100
101
102
103
name: Unit test and Release
on:
pull_request:
push:
branches:
- main
tags:
- '*'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: 8.2
wp: 6.7
- php: 8.1
wp: 6.4
- php: 7.4
wp: 6.2
name: Test on PHP ${{ matrix.php }} / WP ${{ matrix.wp }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: '22'
- name: npm install
run: npm ci
- name: Build
run: |
bash ./bin/build.sh
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
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_PHP_VERSION=${{ matrix.php }} WP_ENV_CORE=WordPress/WordPress#${{ matrix.wp }} npm run wp-env start
- 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 22.x
uses: actions/setup-node@v3
with:
node-version: '22'
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: simple-csv-exporter