-
Notifications
You must be signed in to change notification settings - Fork 39
61 lines (48 loc) · 1.78 KB
/
unit-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
name: Unit Tests
# Run on any changes in public_html
on:
pull_request:
paths:
- public_html/**
push:
branches: [trunk]
paths:
- public_html/**
# Enable manually running action if necessary.
workflow_dispatch:
jobs:
unit-php:
name: PHP
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- name: Setup
uses: WordPress/wporg-repo-tools/.github/actions/setup@trunk
with:
packageManager: "npm"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install WordPress
run: |
chmod -R 767 ./ # TODO: Possibly integrate in wp-env
npm run wp-env start --update
npm run wp-env run tests-cli wp core version
npm run wp-env run tests-cli wp plugin list
- name: Running multisite unit tests
run: npm run test:php
if: ${{ success() || failure() }}
unit-js:
name: JS
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- name: Setup
uses: WordPress/wporg-repo-tools/.github/actions/setup@trunk
with:
packageManager: "npm"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run unit tests on theme data store
run: npm run test:unit --workspace=wporg-pattern-directory-theme
- name: Run unit tests on the pattern creator
run: npm run test:unit --workspace=wporg-pattern-creator