Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Next Next commit
Add GitHub Actions workflows for everything currently handled in Trav…
…is CI.
  • Loading branch information
desrosj committed Oct 12, 2020
commit d98b9f1bf19ac7f493ab074ef0c914bf63e467a9
66 changes: 66 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: PHP Coding standards

on: [push]

jobs:
# Runs PHP coding standards checks.
#
# Violations are reported inline with annotations.
#
# Performs the following steps:
# - Checks out the repository.
# - Configures caching for Composer.
# - Sets up PHP.
# - Logs debug information.
# - Installs Composer dependencies (from cache if possible).
# - Logs PHP_CodeSniffer debug information.
# - Runs PHPCS tests.
# - todo: Add a PHP_CodeSniffer scan for the `tests` directory that does not suppress warnings.
# - todo: Configure Slack notifications for failing scans.
phpcs:
name: Check PHP coding standards
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Set up Composer caching
uses: actions/cache@v2
env:
cache-name: cache-composer-dependencies
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: "latest"
coverage: none

- name: Log debug information
run: |
php --version
composer --version

- name: Install Composer dependencies
run: |
composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction
echo "vendor/bin" >> $GITHUB_PATH

- name: Log PHPCS debug information
run: phpcs -i

- name: Run PHPCS on Core files
uses: wearerequired/lint-action@v1
with:
github_token: ${{ secrets.github_token }}
php_codesniffer: true
# Ignore warnings
php_codesniffer_args: "-n"
102 changes: 102 additions & 0 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: End-to-end Tests

on: [push]

env:
LOCAL_DIR: build
PHP_FPM_UID: 1001 # This needs to be dynamic
PHP_FPM_GID: 116 # This needs to be dynamic

jobs:
# Runs the end-to-end test suite.
#
# Performs the following steps:
# - Cancels all previous workflow runs that have not completed.
# - Checks out the repository.
# - Logs debug information about the runner container.
# - Sets up caching for NPM.
# - Installs NPM 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches)
# _ Installs NPM dependencies.
# - Builds WordPress to run from the `build` directory.
# - Starts the WordPress Docker container.
# - Logs general debug information.
# - Logs the running Docker containers.
# - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container)
# - Install WordPress within the Docker container.
# - Run the E2E tests.
# - todo: Configure Slack notifications for failing tests.
e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs of this workflow
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

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

- name: Log debug information
run: |
npm --version
node --version
curl --version
git --version
svn --version
php --version
php -i
locale -a

- 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 }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-

- name: Install NPM
uses: actions/setup-node@v1
with:
node-version: 12

- name: Install Dependencies
run: npm ci

- name: Build WordPress
run: npm run build

- name: Start Docker environment
run: |
npm run env:start

- name: General debug information
run: |
npm --version
node --version
curl --version
git --version
svn --version

- name: Log running Docker containers
run: docker ps -a

- name: Docker debug information
run: |
docker -v
docker-compose -v
docker-compose run --rm mysql mysql --version
docker-compose run --rm php php --version
docker-compose run --rm php php -m
docker-compose run --rm php php -i
docker-compose run --rm php locale -a

- name: Install WordPress
run: npm run env:install

- name: Run E2E tests
run: npm run test:e2e
62 changes: 62 additions & 0 deletions .github/workflows/javascript-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: JavaScript Tests

on: [push]

jobs:
# Runs the QUnit tests for WordPress.
#
# Performs the following steps:
# - Cancels all previous workflow runs that have not completed.
# - Checks out the repository.
# - Logs debug information about the runner container.
# - Sets up caching for NPM.
# - Installs NPM 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches)
# - Logs updated debug information.
# _ Installs NPM dependencies.
# - Run the WordPress QUnit tests.
# - todo: Configure Slack notifications for failing tests.
test-js:
name: QUnit Tests
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs of this workflow
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

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

- name: Log debug information
run: |
npm --version
node --version
git --version
svn --version

- 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 }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-

- name: Install NPM
uses: actions/setup-node@v1
with:
node-version: 12

- name: Log debug information
run: |
npm --version
node --version

- name: Install Dependencies
run: npm ci

- name: Run QUnit tests
run: npm run grunt travis:js
66 changes: 66 additions & 0 deletions .github/workflows/php-compatibility-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: PHP Compatibility

on: [push]

jobs:

# Runs PHP compatibility testing.
#
# Violations are reported inline with annotations.
#
# Performs the following steps:
# - Checks out the repository.
# - Configures caching for Composer.
# - Sets up PHP.
# - Logs debug information about the runner container.
# - Installs Composer dependencies (from cache if possible).
# - Logs PHP_CodeSniffer debug information.
# - Runs the PHP compatibility tests.
# - todo: Configure Slack notifications for failing scans.
php-comatibility:
name: Check PHP compatibility
runs-on: ubuntu-latest

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

- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Set up Composer caching
uses: actions/cache@v2
env:
cache-name: cache-composer-dependencies
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: "latest"
coverage: none

- name: Log debug information
run: |
php --version
composer --version

- name: Install Composer dependencies
run: |
composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction
echo "vendor/bin" >> $GITHUB_PATH

- name: Log PHPCS debug information
run: phpcs -i

- name: Run PHP compatibility tests
uses: wearerequired/lint-action@v1
with:
github_token: ${{ secrets.github_token }}
php_codesniffer: true
php_codesniffer_args: "--standard=phpcompat.xml.dist"
Loading