Skip to content

Commit 0b965d0

Browse files
authored
az-digital/az_quickstart#3290: Drupal 10.3.x changes. (#111)
1 parent f73ab97 commit 0b965d0

2 files changed

Lines changed: 48 additions & 25 deletions

File tree

.github/workflows/pull-request-checks.yml

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,38 @@ on:
55
- main
66

77
jobs:
8-
pre-merge-checks:
8+
composer:
9+
name: Build AZQS with composer
910
runs-on: ubuntu-latest
1011
steps:
12+
- name: Set up PHP
13+
uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: '8.2'
16+
extensions: mbstring, intl
17+
tools: composer:v2
18+
1119
- name: Checkout branch
1220
uses: actions/checkout@v4
1321
with:
1422
ref: ${{ github.head_ref }}
1523

16-
- name: Check for branch in Quickstart repo
24+
- name: Check for matching branch in Quickstart repo
1725
id: check-quickstart-branch
1826
run: |
19-
EXISTS=$(gh api repos/az-digital/az_quickstart/branches/${{ github.head_ref }} -q '.name' || echo '')
20-
if [[ -z $EXISTS ]]; then
21-
echo "QUICKSTART_BRANCH_NAME=main" >> $GITHUB_ENV
27+
if [ $(git ls-remote --heads https://github.com/az-digital/az_quickstart.git ${{ github.head_ref }} | wc -l) = 1 ]; then
28+
echo "QUICKSTART_BRANCH_NAME=${{ github.head_ref }}" >> ${GITHUB_ENV}
2229
else
23-
echo "QUICKSTART_BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV
30+
echo "QUICKSTART_BRANCH_NAME=main" >> ${GITHUB_ENV}
2431
fi
2532
26-
- name: Check for branch in scaffolding repo
33+
- name: Check for matching branch in scaffolding repo
2734
id: check-scaffolding-branch
2835
run: |
29-
EXISTS=$(gh api repos/az-digital/az-quickstart-scaffolding/branches/${{ github.head_ref }} -q '.name' || echo '')
30-
if [[ -z $EXISTS ]]; then
31-
echo "SCAFFOLDING_BRANCH_NAME=main" >> $GITHUB_ENV
36+
if [ $(git ls-remote --heads https://github.com/az-digital/az-quickstart-scaffolding.git ${{ github.head_ref }} | wc -l) = 1 ]; then
37+
echo "SCAFFOLDING_BRANCH_NAME=${{ github.head_ref }}" >> ${GITHUB_ENV}
3238
else
33-
echo "SCAFFOLDING_BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV
39+
echo "SCAFFOLDING_BRANCH_NAME=main" >> ${GITHUB_ENV}
3440
fi
3541
3642
- name: Checkout scaffolding repo
@@ -40,28 +46,47 @@ jobs:
4046
ref: ${{ env.SCAFFOLDING_BRANCH_NAME }}
4147
path: az-quickstart-scaffolding
4248

43-
- name: Set up PHP
44-
uses: shivammathur/setup-php@v2
45-
with:
46-
php-version: '8.1'
47-
extensions: mbstring, intl
48-
tools: composer:v2
49-
5049
- name: Build Arizona Quickstart
5150
run: |
5251
composer self-update
5352
cd $GITHUB_WORKSPACE/az-quickstart-scaffolding
5453
composer config repositories.az_quickstart vcs https://github.com/az-digital/az_quickstart.git
5554
composer config use-github-api false
56-
composer require --no-update drupal/core-recommended:* zaporylie/composer-drupal-optimizations:* az-digital/az_quickstart:dev-${{ env.QUICKSTART_BRANCH_NAME }}
55+
composer require --no-update az-digital/az_quickstart:dev-${{ env.QUICKSTART_BRANCH_NAME }}
5756
composer require --no-update --dev az-digital/az-quickstart-dev:dev-${{ github.head_ref }}
5857
composer install -o
5958
59+
- name: Save build artifact
60+
uses: actions/cache/save@v4
61+
with:
62+
path: ${{ github.workspace }}/az-quickstart-scaffolding
63+
key: azqs-build-${{ github.sha }}
64+
65+
phpcs:
66+
name: PHP_CodeSniffer
67+
needs: composer
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Restore build artifact cache
71+
uses: actions/cache/restore@v4
72+
with:
73+
path: ${{ github.workspace }}/az-quickstart-scaffolding
74+
key: azqs-build-${{ github.sha }}
6075
- name: Run PHPCS
6176
run: |
6277
cd $GITHUB_WORKSPACE/az-quickstart-scaffolding
6378
composer phpcs
6479
80+
phpstan:
81+
name: PHPStan
82+
needs: composer
83+
runs-on: ubuntu-latest
84+
steps:
85+
- name: Restore build artifact cache
86+
uses: actions/cache/restore@v4
87+
with:
88+
path: ${{ github.workspace }}/az-quickstart-scaffolding
89+
key: azqs-build-${{ github.sha }}
6590
- name: Run PHPStan
6691
run: |
6792
cd $GITHUB_WORKSPACE/az-quickstart-scaffolding

composer.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@
2424
"require": {
2525
"dealerdirect/phpcodesniffer-composer-installer": "*",
2626
"drupal/config_inspector": "2.1.9",
27-
"drupal/core-dev-pinned": "*",
28-
"drupal/devel": "5.1.2",
27+
"drupal/core-dev": "*",
28+
"drupal/devel": "5.1.2 || 5.2.1",
2929
"drupal/migrate_devel": "2.3.0",
30-
"drupal/upgrade_status": "4.0.0",
30+
"drupal/upgrade_status": "4.3.2",
3131
"kint-php/kint": "5.1.1",
3232
"liuggio/fastest": "1.11.0",
33-
"mglaman/phpstan-drupal": "^1.1.30",
3433
"pheromone/phpcs-security-audit": "dev-main",
35-
"phpcompatibility/php-compatibility": "9.3.5",
36-
"phpstan/phpstan-deprecation-rules": "^1.1.3"
34+
"phpcompatibility/php-compatibility": "9.3.5"
3735
},
3836
"extra": {
3937
"branch-alias": {

0 commit comments

Comments
 (0)