-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (53 loc) · 2.17 KB
/
Copy pathtest.yml
File metadata and controls
54 lines (53 loc) · 2.17 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
name: Test
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
services:
mariadb:
image: mariadb:10.6
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Start MySQL
run: |
sudo systemctl start mysql
# Validate that MySQL is running
sudo systemctl status mysql
# Connect to MySQL to test auth.
mysql -e "SELECT 1" -uroot -proot
- name: Install WP-CLI
run: |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
- name: Setup barebones project
env:
HEAD_REF: ${{ github.head_ref }}
run: |
mkdir test_proj && cd test_proj
composer init --name test/test --no-interaction --type=library --stability=dev
composer config repositories.wpunit-helpers '{"type": "vcs", "url": "https://github.com/pantheon-systems/wpunit-helpers.git"}'
composer config allow-plugins.pantheon-systems/wpunit-helpers true
composer require --dev pantheon-systems/wpunit-helpers:dev-$HEAD_REF
- name: Validate that bin files were copied
env:
TEST_PROJECT_DIRECTORY: ${{ github.workspace }}/test_proj
run: ${{ github.workspace }}/.github/workflows/bin/validate-bin-files.sh
- name: Run local install
shell: bash
env:
GITHUB_WORKSPACE: ${{ github.workspace }}
DB_NAME: wordpress_test
DB_USER: root
DB_PASS: root
DB_HOST: 127.0.0.1
run: ${{ github.workspace }}/.github/workflows/bin/run-local-tests.sh
- name: Run PHPUnit Test Installs
run: |
echo "Running PHPUnit tests (skip nightly)"
bash ${{ github.workspace }}/test_proj/bin/phpunit-test.sh --skip-nightly --tmpdir=${{ github.workspace }}/local_tests
echo -e "\n\n"
echo "Running PHPUnit tests (with nightly)"
bash ${{ github.workspace }}/test_proj/bin/phpunit-test.sh --skip-db --tmpdir=${{ github.workspace }}/local_tests