Skip to content

az-digital/az_quickstart#3290: Drupal 10.3.x changes. #42

az-digital/az_quickstart#3290: Drupal 10.3.x changes.

az-digital/az_quickstart#3290: Drupal 10.3.x changes. #42

name: Pull Request Checks
on:
pull_request:
branches:
- main
jobs:
composer:
name: Build AZQS with composer
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, intl
tools: composer:v2
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Check for matching branch in Quickstart repo
id: check-quickstart-branch
run: |
if [ $(git ls-remote --heads https://github.com/az-digital/az_quickstart.git ${{ github.head_ref }} | wc -l) = 1 ]; then
echo "QUICKSTART_BRANCH_NAME=${{ github.head_ref }}" >> ${GITHUB_ENV}
else
echo "QUICKSTART_BRANCH_NAME=main" >> ${GITHUB_ENV}
fi
- name: Check for matching branch in scaffolding repo
id: check-scaffolding-branch
run: |
if [ $(git ls-remote --heads https://github.com/az-digital/az-quickstart-scaffolding.git ${{ github.head_ref }} | wc -l) = 1 ]; then
echo "SCAFFOLDING_BRANCH_NAME=${{ github.head_ref }}" >> ${GITHUB_ENV}
else
echo "SCAFFOLDING_BRANCH_NAME=main" >> ${GITHUB_ENV}
fi
- name: Checkout scaffolding repo
uses: actions/checkout@v4
with:
repository: az-digital/az-quickstart-scaffolding
ref: ${{ env.SCAFFOLDING_BRANCH_NAME }}
path: az-quickstart-scaffolding
- name: Build Arizona Quickstart
run: |
composer self-update
cd $GITHUB_WORKSPACE/az-quickstart-scaffolding
composer config repositories.az_quickstart vcs https://github.com/az-digital/az_quickstart.git
composer config use-github-api false
composer require --no-update az-digital/az_quickstart:dev-${{ env.QUICKSTART_BRANCH_NAME }}
composer require --no-update --dev az-digital/az-quickstart-dev:dev-${{ github.head_ref }}
composer install -o
- name: Save build artifact
uses: actions/cache/save@v3
with:
path: ${{ github.workspace }}/az-quickstart-scaffolding
key: azqs-build-${{ github.sha }}
phpcs:
name: PHP_CodeSniffer
needs: composer
runs-on: ubuntu-latest
steps:
- name: Restore build artifact cache
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}/az-quickstart-scaffolding
key: azqs-build-${{ github.sha }}
- name: Run PHPCS
run: |
cd $GITHUB_WORKSPACE/az-quickstart-scaffolding
composer phpcs
phpstan:
name: PHPStan
needs: composer
runs-on: ubuntu-latest
steps:
- name: Restore build artifact cache
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}/az-quickstart-scaffolding
key: azqs-build-${{ hashFiles('../composer.json') }}
- name: Run PHPStan
run: |
cd $GITHUB_WORKSPACE/az-quickstart-scaffolding
./vendor/bin/phpstan analyse --configuration web/profiles/custom/az_quickstart/phpstan.neon web/profiles/custom/az_quickstart