Skip to content

Commit dabdd12

Browse files
authored
Merge pull request #814 from alleyinteractive/fix/github-tests
Move CI to GitHub Actions
2 parents 413a192 + 59cad01 commit dabdd12

File tree

76 files changed

+1149
-1036
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1149
-1036
lines changed

.github/workflows/phpcs.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: PHPCS
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
coding-standards:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: true
11+
12+
name: Coding Standards
13+
steps:
14+
- name: Cancel previous runs of this workflow (pull requests only)
15+
if: ${{ github.event_name == 'pull_request' }}
16+
uses: styfle/cancel-workflow-action@0.5.0
17+
with:
18+
access_token: ${{ github.token }}
19+
20+
- name: Check out code
21+
uses: actions/checkout@v2
22+
23+
- name: Get Composer cache directory
24+
id: composer-cache
25+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
26+
27+
- name: Set up Composer caching
28+
uses: actions/cache@v2
29+
env:
30+
cache-name: cache-composer-dependencies
31+
with:
32+
path: ${{ steps.composer-cache.outputs.dir }}
33+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-composer-
36+
37+
- name: Set up PHP
38+
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: '7.4'
41+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
42+
tools: composer:v2
43+
coverage: none
44+
45+
- name: Validate Composer config
46+
run: composer validate --strict
47+
48+
- name: Install composer dependencies
49+
uses: nick-invision/retry@v1
50+
with:
51+
timeout_minutes: 5
52+
max_attempts: 5
53+
command: composer install
54+
55+
- name: Run PHPCS
56+
run: composer run phpcs -- -v

.github/workflows/phpunit.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: PHPUnit
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
tests:
8+
runs-on: ubuntu-latest
9+
10+
services:
11+
mysql:
12+
image: mysql:5.7
13+
env:
14+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
15+
ports:
16+
- 3306:3306
17+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
18+
continue-on-error: ${{ matrix.can_fail }}
19+
strategy:
20+
fail-fast: true
21+
matrix:
22+
php: [8.0, 7.4, 5.6]
23+
wp_version: ["latest"]
24+
can_fail: [false]
25+
multisite: [0,1]
26+
27+
name: WordPress ${{ matrix.wp_version }} @ PHP ${{ matrix.php }} (WP_MULTISITE=${{ matrix.multisite }})
28+
env:
29+
CACHEDIR: /tmp/test-cache
30+
WP_CORE_DIR: /tmp/wordpress/
31+
WP_TESTS_DIR: /tmp/wordpress-tests-lib
32+
WP_VERSION: ${{ matrix.wp_version }}
33+
WP_MULTISITE: ${{ matrix.multisite }}
34+
35+
steps:
36+
- name: Check out code
37+
uses: actions/checkout@v2
38+
39+
- name: Get Composer cache directory
40+
id: composer-cache
41+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
42+
43+
- name: Set up Composer caching
44+
uses: actions/cache@v2
45+
env:
46+
cache-name: cache-composer-dependencies
47+
with:
48+
path: |
49+
${{ steps.composer-cache.outputs.dir }}
50+
/tmp/test-cache
51+
/tmp/wordpress
52+
key: ${{ runner.os }}-composer-${{ matrix.php }}
53+
restore-keys: |
54+
${{ runner.os }}-composer-
55+
56+
- name: Set up PHP
57+
uses: shivammathur/setup-php@v2
58+
with:
59+
php-version: ${{ matrix.php }}
60+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
61+
tools: composer:v2
62+
coverage: none
63+
64+
- name: Install Composer dependencies
65+
uses: nick-invision/retry@v2
66+
with:
67+
timeout_minutes: 5
68+
max_attempts: 5
69+
command: composer install
70+
new_command_on_retry: composer install --ignore-platform-reqs
71+
72+
- name: Install WordPress and copy project
73+
shell: bash
74+
run: |
75+
bash <(curl -s "https://raw.githubusercontent.com/wp-cli/sample-plugin/master/bin/install-wp-tests.sh") wordpress_test root '' 127.0.0.1 latest
76+
77+
rm -rf "${WP_CORE_DIR}wp-content/plugins"
78+
mkdir -p "${WP_CORE_DIR}wp-content/plugins/wordpress-fieldmanager"
79+
rsync -a --exclude=.git . "${WP_CORE_DIR}wp-content/plugins/wordpress-fieldmanager"
80+
81+
- name: Run tests
82+
shell: bash
83+
run: |
84+
cd ${WP_CORE_DIR}wp-content/plugins/wordpress-fieldmanager
85+
composer run phpunit

.gitignore

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
1-
tests/php/build
2-
tests/php/wp-unit-test
1+
# Dependencies
2+
vendor
3+
node_modules
4+
.env
5+
composer.lock
36

4-
# Silly Macs
5-
.DS_Store
7+
# Log files
8+
*.log
69

7-
# For those using Git in their SVN
8-
# ignore files in the WPcom plugin directory
9-
wpcom-helper.php
10-
VERSION
11-
tests/php/tests
12-
todo.txt
10+
# Cache files
11+
.phpcs/*.json
12+
.phpunit.result.cache
1313

14-
# Created by Apigen for logs
15-
/build
14+
# Ignore temporary OS files
15+
.DS_Store
16+
.DS_Store?
17+
.Spotlight-V100
18+
.Trashes
19+
ehthumbs.db
20+
Thumbs.db
21+
.thumbsdb
1622

17-
/docs
23+
# IDE files
24+
*.code-workspace
25+
.idea
26+
.vscode
1827

19-
/report/
28+
# Created by Apigen for logs
29+
build/
2030

21-
.svn
31+
# Built docs
32+
docs/
2233

23-
composer.lock
24-
/vendor/
25-
/node_modules
26-
.idea/
34+
# Code coverage report
35+
report/

.phpcs/.gitkeep

Whitespace-only changes.

.travis.yml

Lines changed: 0 additions & 91 deletions
This file was deleted.

Gruntfile.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,11 @@ module.exports = function( grunt ) {
3535
}
3636
}
3737
},
38-
phpcs: {
39-
plugin: {},
40-
options: {
41-
bin: "vendor/bin/phpcs",
42-
showSniffCodes: true,
43-
standard: "phpcs.ruleset.xml",
44-
verbose: true,
45-
warningSeverity: 0,
46-
}
47-
},
4838
});
4939

5040

5141
grunt.loadNpmTasks( 'grunt-contrib-connect' );
5242
grunt.loadNpmTasks( 'grunt-contrib-qunit' );
53-
grunt.loadNpmTasks( 'grunt-phpcs' );
5443

5544
grunt.task.run( 'connect' );
5645

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,26 @@
22

33
Fieldmanager is a comprehensive toolkit for building forms, metaboxes, and custom admin screens for WordPress.
44

5-
[![Build Status](https://travis-ci.org/alleyinteractive/wordpress-fieldmanager.svg?branch=master)](https://travis-ci.org/alleyinteractive/wordpress-fieldmanager)
6-
75
## Using Fieldmanager in your WordPress Project
86

97
Fieldmanager is a powerful library which can make the development of sophisticated features a breeze. To get started, simply [download](#downloads-and-versioning) and install this plugin into your plugins directory and activate it on the plugins screen. To learn how to use Fieldmanager's API, visit the project's official website at [Fieldmanager.org](http://fieldmanager.org). There is also [a demo plugin](https://github.com/alleyinteractive/fieldmanager-demos) which illustrates a lot of what you can do with Fieldmanager.
108

119
## Requirements
1210

13-
* WordPress: 4.7+
14-
* PHP: 7.0+
11+
* WordPress: 5.8+
12+
* PHP: 7.4+
1513

16-
Fieldmanager is tested down to and works on PHP 5.3-5.6, but we don't officially support PHP5. We strongly encourage using PHP7.
14+
Fieldmanager is tested down to and works on PHP 5.6, but we don't officially support PHP 5. We strongly encourage using PHP 7.4 or 8.
1715

1816
## Downloads and Versioning.
1917

2018
You can view [Fieldmanager's official releases here](https://github.com/alleyinteractive/wordpress-fieldmanager/releases).
2119

22-
The `master` branch on GitHub is the "bleeding edge" release. As of 1.0, Fieldmanager will maintain a typical release cycle, with alpha, beta, and RC releases, and we hope to move through "minor" versions pretty quickly. While we encourage everyone to develop with and test on early releases and help us find the bugs, stable releases are recommended for production.
20+
The `main` branch on GitHub is the "bleeding edge" release. As of 1.0, Fieldmanager will maintain a typical release cycle, with alpha, beta, and RC releases, and we hope to move through "minor" versions pretty quickly. While we encourage everyone to develop with and test on early releases and help us find the bugs, stable releases are recommended for production.
2321

2422
## Contributing to Development
2523

26-
Development of Fieldmanager happens on [Github](http://github.com/alleyinteractive/wordpress-fieldmanager). Bugs with Fieldmanager should be addressed in the Github issue queue, and enhancements or bug fixes should be submitted as pull requests, which are always welcome.
24+
Development of Fieldmanager happens on [GitHub](http://github.com/alleyinteractive/wordpress-fieldmanager). Bugs with Fieldmanager should be addressed in the GitHub issue queue, and enhancements or bug fixes should be submitted as pull requests, which are always welcome.
2725

2826
## Generating Documentation
2927

0 commit comments

Comments
 (0)