Skip to content

Update liuggio/fastest requirement from 1.11.0 to 1.13.1 #94

Update liuggio/fastest requirement from 1.11.0 to 1.13.1

Update liuggio/fastest requirement from 1.11.0 to 1.13.1 #94

name: Pull Request Checks
on:
pull_request:
branches:
- main
- 1.x
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.3'
- uses: actions/checkout@v4
- name: Find the pull request source branch name
run: |
echo "AZ_SOURCE_REF=${GITHUB_HEAD_REF}" >> ${GITHUB_ENV}
echo "AZ_TARGET_REF=${GITHUB_BASE_REF}" >> ${GITHUB_ENV}
- name: Set default branches for scaffolding and profile repos if ref is 1.*
if: startsWith(github.base_ref, '1.') || startsWith(github.ref_name, '1.')
id: test-1-x
run: |
echo "DEFAULT_SCAFFOLD_BRANCH=2.x" >> ${GITHUB_ENV}
echo "DEFAULT_PROFILE_BRANCH=2.x" >> ${GITHUB_ENV}
- name: Fallback to main branch
if: steps.test-1-x.outcome == 'skipped'
run: |
echo "DEFAULT_SCAFFOLD_BRANCH=main" >> ${GITHUB_ENV}
echo "DEFAULT_PROFILE_BRANCH=main" >> ${GITHUB_ENV}
- name: Set variables
run: |
if [ $(git ls-remote --heads https://github.com/az-digital/az_quickstart.git $AZ_SOURCE_REF | wc -l) = 1 ]; then
echo "QUICKSTART_BRANCH_NAME=${AZ_SOURCE_REF}" >> ${GITHUB_ENV}
elif [ $(git ls-remote --heads https://github.com/az-digital/az_quickstart.git $AZ_TARGET_REF | wc -l) = 1 ]; then
echo "QUICKSTART_BRANCH_NAME=${AZ_TARGET_REF}" >> ${GITHUB_ENV}
else
echo "QUICKSTART_BRANCH_NAME=${DEFAULT_PROFILE_BRANCH}" >> ${GITHUB_ENV}
fi
if [ $(git ls-remote --heads https://github.com/az-digital/az-quickstart-scaffolding.git $AZ_SOURCE_REF | wc -l) = 1 ]; then
echo "SCAFFOLDING_BRANCH_NAME=${AZ_SOURCE_REF}" >> ${GITHUB_ENV}
elif [ $(git ls-remote --heads https://github.com/az-digital/az-quickstart-scaffolding.git $AZ_TARGET_REF | wc -l) = 1 ]; then
echo "SCAFFOLDING_BRANCH_NAME=${AZ_TARGET_REF}" >> ${GITHUB_ENV}
else
echo "SCAFFOLDING_BRANCH_NAME=${DEFAULT_SCAFFOLD_BRANCH}" >> ${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: |
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
./quickstart_branch.sh --branch ${QUICKSTART_BRANCH_NAME}
if [[ ${AZ_SOURCE_REF} =~ ^[0-9]\.[0-9x] ]]; then
DEV_PACKAGE_VERSION="${AZ_SOURCE_REF}-dev"
else
DEV_PACKAGE_VERSION="dev-${AZ_SOURCE_REF}"
fi
composer require --no-update --dev az-digital/az-quickstart-dev:${DEV_PACKAGE_VERSION}
composer install -o
- name: Save build artifact
uses: actions/cache/save@v4
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@v4
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@v4
with:
path: ${{ github.workspace }}/az-quickstart-scaffolding
key: azqs-build-${{ github.sha }}
- 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