generated from benjifisher/project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (46 loc) · 1.82 KB
/
coding_standards.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: coding_standards
# Run this workflow every time a new commit is pushed to the repo
on:
push:
# The following will run on The 1st and 15th of every month at 1:30 UTC
schedule:
- cron: '30 1 1,15 * *'
workflow_dispatch:
jobs:
run-unit-tests:
name: Check for Drupal Coding Standards issues
runs-on: ubuntu-latest
env:
MODULE: warmer
COMPOSER_MEMORY_LIMIT: -1
# Note, the username, password, port and db match mysql service setup.
SIMPLETEST_DB: mysql://root:root@127.0.0.1:3306/warmer
SIMPLETEST_BASE_URL: http://localhost:8888
PROJECT_ROOT: .
DRUPAL_ROOT: ./docroot
PHP_VERSION: '8.1'
steps:
- uses: actions/checkout@v2
- name: Set up php version ${{ env.PHP_VERSION }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: date, dom, filter, gd, hash, json, mbstring, pcre, pdo, session, tokenizer, xml
# Includes code coveage for phpunit, but disables xDebug
coverage: pcov
- name: Get Composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
# Create new drupal project with Composer install
- name: Install Drupal with Composer
run: composer update
# Install Drupal for deprecation checking purposes
- name: Check for Drupal Coding Standards
run: $(pwd)/vendor/bin/phpcs -p docroot/modules/contrib/${{ env.MODULE }}