-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (44 loc) · 1.85 KB
/
build-and-deploy.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
48
name: Build and deploy
on:
push:
branches:
- develop
- main
- feature/dg-98-build-and-configure-pipeline
permissions:
contents: read
packages: write
jobs:
php-lint:
name: PHP Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nodejs
uses: actions/setup-node@v4
- name: Set env.BRANCH
run: |
echo "BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)" >> $GITHUB_ENV
- name: Build Node
run: ./orch/build_node.sh
- name: Install PHP
run: bash ./scripts/pipeline/deb-php-install.sh
- name: Install Linters and Sniffers
run: |
composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer false
composer global require --dev drupal/coder php-parallel-lint/php-parallel-lint squizlabs/php_codesniffer=*
COMPOSER_DIR=$(composer -n config --global home)
$COMPOSER_DIR/vendor/bin/phpcs --config-set installed_paths $COMPOSER_DIR/vendor/drupal/coder/coder_sniffer,$COMPOSER_DIR/vendor/sirbrillig/phpcs-variable-analysis,$COMPOSER_DIR/vendor/slevomat/coding-standard
mkdir -p /tmp/results
touch /tmp/results/php-lint.log
touch /tmp/results/php-cs.log
touch /tmp/results/theme-lint.log
- name: PHP Lint
run: |
COMPOSER_DIR=$(composer -n config --global home)
$COMPOSER_DIR/vendor/bin/parallel-lint -e php,module,inc,install,test,profile,theme ./usagov_benefit_finder # | tee /tmp/results/php-lint.log
- name: PHP CodeSniff (Ignore warnings)
run: |
COMPOSER_DIR=$(composer -n config --global home)
$COMPOSER_DIR/vendor/bin/phpcs --standard=./usagov-2021/.phpcs.xml.dist -v --warning-severity=0 ./usagov_benefit_finder # | tee /tmp/results/php-cs.log