-
-
Notifications
You must be signed in to change notification settings - Fork 13
executable file
·137 lines (118 loc) · 4.51 KB
/
test-deploy.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: test-deploy
on: [push, pull_request]
jobs:
test:
if: >-
startsWith(github.ref, 'refs/tags')
|| contains(github.event.head_commit.message, '[ci]')
name: PHP Unit tests
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0', '8.1', '8.2' ] # https://www.php.net/supported-versions
wordpress: [ 'latest' ] # https://wordpress.org/download/releases/
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: dbpass
MYSQL_DATABASE: dbname
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout Websites
uses: actions/checkout@v3
with:
repository: nextgenthemes/websites
ref: master
path: .
token: ${{ secrets.REPO_TOKEN }}
- name: rm -rf symbiosistheme.com
run: rm -rf symbiosistheme.com
- name: rm composer.json
run: rm composer.json
- name: Checkout ARVE
uses: actions/checkout@v3
with:
repository: nextgenthemes/advanced-responsive-video-embedder
path: symbiosistheme.com/web/app/plugins/advanced-responsive-video-embedder
token: ${{ secrets.REPO_TOKEN }}
- name: Checkout ARVE Pro
uses: actions/checkout@v3
with:
repository: nextgenthemes/arve-pro
ref: master
path: symbiosistheme.com/web/app/plugins/arve-pro
token: ${{ secrets.REPO_TOKEN }}
- name: Checkout ARVE Random Video
uses: actions/checkout@v3
with:
repository: nextgenthemes/arve-random-video
ref: master
path: symbiosistheme.com/web/app/plugins/arve-random-video
token: ${{ secrets.REPO_TOKEN }}
- name: Checkout ARVE AMP
uses: actions/checkout@v3
with:
repository: nextgenthemes/arve-amp
ref: master
path: symbiosistheme.com/web/app/plugins/arve-amp
token: ${{ secrets.REPO_TOKEN }}
- name: Checkout ARVE Sticky Videos
uses: actions/checkout@v3
with:
repository: nextgenthemes/arve-sticky-videos
ref: master
path: symbiosistheme.com/web/app/plugins/arve-sticky-videos
token: ${{ secrets.REPO_TOKEN }}
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067 # 2.26.0 # https://github.com/shivammathur/setup-php/releases/
with:
php-version: ${{ matrix.php }}
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
extensions: mbstring, dom, zip, mysql, gd
tools: phpunit-polyfills:1
coverage: none #optional
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Install WP Tests
run: bash ./bin/install-wp-tests.sh dbname root dbpass "127.0.0.1:$DB_PORT" ${{ matrix.wordpress }} true
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
- name: Run PHPUnit without code coverage
run: phpunit --testsuite advanced-responsive-video-embedder,arve-pro,arve-random-video,arve-amp,arve-sticky-videos
deploy:
if: >-
startsWith(github.ref, 'refs/tags')
&& ! startsWith(github.event.repository.name, 'arve-')
&& ! contains(github.ref, 'alpha')
needs: test
name: SVN commit to wp.org
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: advanced-responsive-video-embedder
- run: pwd
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Set composer shared code repo
working-directory: advanced-responsive-video-embedder
run: composer config repositories.0 git https://github.com/nextgenthemes/wp-shared
- name: composer update --optimize-autoloader
working-directory: advanced-responsive-video-embedder
run: composer update --optimize-autoloader
- name: Deploy
uses: nextgenthemes/action-wordpress-plugin-deploy@master
with:
workdir: advanced-responsive-video-embedder
build_dirs: vendor
version: ${{ steps.get_version.outputs.VERSION }}
svn_user: ${{ secrets.SVN_USERNAME }}
svn_pass: ${{ secrets.SVN_PASSWORD }}
verbose: true