Skip to content

Commit fcb0828

Browse files
authored
Add Github actions / Local environment (WordPress#240)
* Setup github workflow for testing. * Remove Travis config * Just run with PHP 7.4 * Run unit tests via the wp-env containers. * Split install/setup/test steps * Set the PHP version with the env vars * Ignore composer.lock during unit test.
1 parent d4d8751 commit fcb0828

File tree

6 files changed

+2525
-35
lines changed

6 files changed

+2525
-35
lines changed

.github/workflows/unit-test.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Unit Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
jobs:
9+
test-php:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php:
15+
- '7.4'
16+
17+
env:
18+
WP_ENV_PHP_VERSION: ${{ matrix.php }}
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Install
25+
run: npm install
26+
27+
- name: Setup Environment
28+
run: |
29+
rm composer.lock
30+
npm run setup
31+
32+
- name: Test
33+
run: npm run test

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
vendor
22
coverage
3+
node_modules

.travis.yml

-35
This file was deleted.

.wp-env.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"phpVersion": "7.4",
3+
"plugins": [
4+
".",
5+
"https://downloads.wordpress.org/plugin/posts-to-posts.latest-stable.zip"
6+
]
7+
}

0 commit comments

Comments
 (0)