Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Github Actions #383

Merged
merged 52 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
dab740d
Github Actions: support for phpcs
Mar 13, 2021
9427163
Github Actions: support for phpunit
Mar 16, 2021
7b00bfa
Github Actions: fixing a syntax error in the yaml file
Mar 16, 2021
f754f8f
Github Actions: fixing a syntax error in the yaml file
Mar 16, 2021
17c621a
Github Actions: updating composer.lock
Mar 16, 2021
dd9ae3c
Github Actions: updating composer.lock
Mar 16, 2021
b021d1e
Github Actions: updating composer and its lock
Mar 16, 2021
de0ed12
Github Actions: updating composer.lock
Mar 16, 2021
93971c7
Github Actions: update the composer install action
Mar 16, 2021
b44f435
Gitbub Actions: updating @wordpress/env to latest
Mar 17, 2021
cafd111
Github Actions:test changing the plugin name to uppercase
Mar 17, 2021
beed9ab
Github Actions: testing the matrix with WP/PHP versions
Mar 19, 2021
c8dad3a
Github Actions: using a better composer action and fixing yml file
Mar 19, 2021
625bcc6
Github Actions: test using bp-rest name rather than BP-REST
Mar 19, 2021
362be35
Github Actions: revert and fix test
Mar 19, 2021
7cf8e43
Github Actions: outputting WP version
Mar 19, 2021
86e47d3
Github Actions: Testing new matrix
Mar 19, 2021
5243155
Github Actions: run correct phpunit version for PHP 5.6
Mar 19, 2021
0bab6aa
Github Actions: using proper phpunit version format
Mar 19, 2021
560a6d0
Github Actions: allow upgrade of packages
Mar 19, 2021
28d2900
Github Actions: trying to fix PHP 5.6 to 7.0
Mar 19, 2021
cebc106
Github Actions: use only the matrix that supports wp-env
Mar 19, 2021
55f200c
Github Actions: Testing PHP 5.6
Mar 19, 2021
80406fd
Github Actions: allow PHP 5.6 to fail
Mar 19, 2021
b0e8b6c
Github Actions: allow PHP 5.6 to fail
Mar 19, 2021
11d681d
Github Actions: allow PHP 5.6 to fail
Mar 19, 2021
c806e3f
Github Actions: allow PHP 5.6 to fail
Mar 19, 2021
dc6ef29
Github Actions: allow PHP 5.6 to fail
Mar 19, 2021
1ccc77a
Github Actions: reverting the fail
Mar 19, 2021
127c2b6
Github Actions: reverting the fail
Mar 19, 2021
ef15d5e
Github Actions: test PHP 5.6
Mar 19, 2021
8d22970
Github Actions: another attempy
Mar 19, 2021
729248a
Github Actions: adding proper wp-phpunit version
Mar 19, 2021
50af3ea
Github Actions: removing phpunit package
Mar 19, 2021
5d4f09a
Github Actions: updating test setup
Mar 19, 2021
14339d1
Github Action: fire GA
Mar 19, 2021
7201799
Github Actions: fire GH
Mar 19, 2021
fd2f53e
Github Actions: fire GH;
Mar 19, 2021
e92e090
Github Actions: removing unneeded variable
Mar 19, 2021
75bea6c
Github Actions: another try
Mar 19, 2021
80ae0c9
Github Actions:experimental actions can fail
Mar 19, 2021
8e3bb84
Github Actions:experimental actions can fail
Mar 19, 2021
cef5153
Github Actions: Updating matrix and removing Travis file
Mar 19, 2021
b6a6d6e
Github Actions: removing experimental actions
Mar 19, 2021
8077628
Github Actions: removing experimental actions
Mar 19, 2021
51f5784
Github Actions: removing experimental actions
Mar 19, 2021
82346cd
Github Actions: removing experimental actions
Mar 19, 2021
bb7b028
Github Actions: removing experimental actions
Mar 19, 2021
8e94287
Github Actions: decreasing matrix number
Mar 19, 2021
2f4e197
Github Actions: removing wp-phpunit action since it is unnecessary
Mar 19, 2021
99e9e71
Github Actions: maintenance actions
Mar 19, 2021
fdd7b2b
Github Actions: removing travis status badge
renatonascalves Mar 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Coding Standards

on: pull_request

jobs:
phpcs:
name: PHPCS
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: ['8.0']

steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request' }}
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: Log information
run: |
echo "$GITHUB_REF"
echo "$GITHUB_EVENT_NAME"
git --version
php --version
composer --version

- name: Validate Composer
run: composer validate --strict

- name: Install dependencies
uses: ramsey/composer-install@v1
with:
composer-options: "--ignore-platform-reqs"

- name: Run PHPCS
run: composer phpcs
98 changes: 98 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Unit Tests

on: pull_request

jobs:
tests:
name: "WP: ${{ matrix.wp_version }} - PHP: ${{ matrix.php }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0']
wp_version: ['master']
include:
- php: '8.0'
wp_version: '5.7'
- php: '7.4'
wp_version: '5.7'
env:
WP_ENV_PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wp_version }}

steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request' }}
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout repository
uses: actions/checkout@v2

- name: Check Gitignored files
run: if [[ ! -z $(git ls-files -i --exclude-standard) ]]; then exit 1; fi

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: Log information
run: |
echo "$GITHUB_REF"
echo "$GITHUB_EVENT_NAME"
npm --version
node --version
git --version
php --version
composer --version

- name: Validate Composer
run: composer validate --strict

- name: Install Composer dependencies
uses: ramsey/composer-install@v1
with:
composer-options: "--ignore-platform-reqs"

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Validate node modules
run: if [[ -f package.json ]]; then npm audit --audit-level=high --production --cache ~/.npm; fi

- name: Install node modules
run: npm ci --cache ~/.npm

- name: Setup WordPress
run: echo "{\"core\":\"WordPress/WordPress#${WP_VERSION}\"}" >> .wp-env.override.json

- name: Install WordPress
run: |
chmod -R 767 ./
npm run wp-env start -- --update

- name: Running single site unit tests
run: npm run phpunit
if: ${{ success() || failure() }}

- name: Running multisite unit tests
run: npm run phpunit:mu
if: ${{ success() || failure() }}

- name: Stop Docker environment
run: npm run wp-env stop
if: ${{ success() || failure() }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/npm-debug.log
/vendor/
.vscode
.wp-env.override.json

# Operating system specific files
.DS_Store
Expand Down
129 changes: 0 additions & 129 deletions .travis.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"core": "WordPress/WordPress#master",
"plugins": [ ".", "buddypress/BuddyPress#master" ],
"config": {
"WP_DEBUG": true,
"SCRIPT_DEBUG": true
}
}
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

Access your BuddyPress site's data through an easy-to-use HTTP REST API.

[![Build Status](https://travis-ci.org/buddypress/BP-REST.svg?branch=master)](https://travis-ci.org/buddypress/BP-REST)

## Documentation

We have extensive documentation of each endpoint/components and their CRUD actions: <https://developer.buddypress.org/bp-rest-api/>
Expand Down
46 changes: 24 additions & 22 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,36 @@
"description": "REST API endpoints for BuddyPress",
"type": "library",
"keywords": [
"bp-rest",
"bp-rest-api",
"buddypress",
"plugin"
],
"homepage": "https://buddypress.org",
"license": "GPL-2.0-or-later",
"bp-rest",
"bp-rest-api",
"buddypress",
"plugin"
],
"homepage": "https://buddypress.org",
"license": "GPL-2.0-or-later",
"authors": [ {
"name": "BuddyPress Community",
"homepage": "https://buddypress.org/about/"
} ],
"name": "BuddyPress Community",
"homepage": "https://buddypress.org/about/"
} ],
"support": {
"forum": "https://buddypress.org/support/",
"docs": "https://codex.buddypress.org/",
"issues": "https://buddypress.trac.wordpress.org/",
"rss": "https://buddypress.org/feed/",
"source": "https://buddypress.trac.wordpress.org/browser/",
"wiki": "https://codex.buddypress.org/"
},
"forum": "https://buddypress.org/support/",
"docs": "https://codex.buddypress.org/",
"issues": "https://buddypress.trac.wordpress.org/",
"rss": "https://buddypress.org/feed/",
"source": "https://buddypress.trac.wordpress.org/browser/",
"wiki": "https://codex.buddypress.org/"
},
"require": {
"composer/installers": "^1.10.0",
"php": ">=5.6.0"
},
"composer/installers": "^1.10.0",
"php": ">=5.6.0"
},
"require-dev": {
"squizlabs/php_codesniffer" : "^3.5.4",
"phpcompatibility/phpcompatibility-wp": "^2.1.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"wp-coding-standards/wpcs": "*"
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"wp-coding-standards/wpcs": "*",
"phpunit/phpunit": "^7.5",
"wp-phpunit/wp-phpunit": "^5.7"
},
"scripts": {
"phpcs" : "phpcs . --basepath=.",
Expand Down
Loading