Skip to content

Instantly share code, notes, and snippets.

@mcnamee
Created March 4, 2020 22:51
Show Gist options
  • Save mcnamee/be9a9187dbc1d75c4e4507ae85955d21 to your computer and use it in GitHub Desktop.
Save mcnamee/be9a9187dbc1d75c4e4507ae85955d21 to your computer and use it in GitHub Desktop.
Ultimate PHP + JS Pipelines Tests
pipelines:
custom:
# PHPCS
# ---------------------------------------------------------------
phpcs:
- step:
image: edbizarro/gitlab-ci-pipeline-php:7.4-alpine
caches:
- composer
script:
# Add Composer packages to path (so we can simply run `phpcs`)
- export PATH="/home/php/.composer/vendor/bin:$PATH"
# Install PHPCS
- composer global require squizlabs/php_codesniffer wp-coding-standards/wpcs
# Configure PHPCS to additinoally use WP Code standards
- phpcs --config-set installed_paths /home/php/.composer/vendor/wp-coding-standards/wpcs
# Run the linter across the project
- phpcs
# PHPUnit
# ---------------------------------------------------------------
phpunit:
- step:
image: edbizarro/gitlab-ci-pipeline-php:7.4-alpine
caches:
- composer
script:
# Install packages
- composer install --prefer-dist --no-ansi --no-interaction --no-progress
# Run PHPUnit
- php -d memory_limit=-1 ./vendor/bin/phpunit
# Eslint
# ---------------------------------------------------------------
eslint:
- step:
image: node:13-alpine
caches:
- node
script:
# Change to theme directory
# - cd web/app/themes/pvtl-child
# Install packages
- npm install
# Run the linter across the project
- npm run lint-js
# Jest Tests
# ---------------------------------------------------------------
jest:
- step:
caches:
- node
script:
# Install packages
- npm install
# Run the linter across the project
- npm run test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment