-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (53 loc) · 1.73 KB
/
tests.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
name: PHPUnit, PHPCS, Psalm
on: # event list
push: # on push to each of these branches
branches:
- dev
- fix
- master
pull_request:
branches:
- dev
- master
env: # environment variables (available in any part of the action)
PHP_VERSION: 7.4
jobs:
build:
name: PHPUnit, PHPCS, Psalm
runs-on: ubuntu-22.04
env:
DB_CONNECTION: mysql
DB_HOST: localhost
DB_PORT: 3306
DB_DATABASE: wordpress_test
DB_USERNAME: root
DB_PASSWORD: root
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
- name: Run MySQL server
run: sudo systemctl start mysql
- name: Code Checkout
uses: actions/checkout@v4
- name: Make the script files executable
run: chmod +x ./tests/wp-test-setup.sh
- name: Install WP develop
run: ./tests/wp-test-setup.sh wordpress_test root root localhost latest
- name: Install Dependencies
run: composer i
- name: Running tests
run: composer test
- name: Telegram notify
if: failure()
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_PLUGINS_TO }}
token: ${{ secrets.TELEGRAM_REVIEWER_TOKEN }}
message: |
Hi, <strong>${{ github.actor }}</strong>! Your commit for <strong>${{ github.repository }}</strong>
contains 💯 the best solution but it have to be fixed!
<a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}">Auto-Tests (PHPUnit, PHPCS, Psalm)</a> build failed ⛔!
format: html
disable_web_page_preview: true