Skip to content

Commit a836cfc

Browse files
committed
GH Actions: minor tweaks
Minor workflow simplifications by merging two steps into one.
1 parent 544253b commit a836cfc

File tree

2 files changed

+9
-31
lines changed

2 files changed

+9
-31
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,11 @@ jobs:
4848

4949
# Install dependencies and handle caching in one go.
5050
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
51-
- name: Install Composer dependencies - normal
52-
if: matrix.php != 'nightly'
51+
- name: Install Composer dependencies
5352
uses: "ramsey/composer-install@v3"
5453
with:
55-
# Bust the cache at least once a month - output format: YYYY-MM.
56-
custom-cache-suffix: $(date -u "+%Y-%m")
57-
58-
- name: Install Composer dependencies - ignore PHP restrictions
59-
if: matrix.php == 'nightly'
60-
uses: "ramsey/composer-install@v3"
61-
with:
62-
composer-options: --ignore-platform-req=php+
54+
# For PHP "nightly", we need to install with ignore platform reqs as not all dependencies may allow it yet.
55+
composer-options: ${{ matrix.php == 'nightly' && '--ignore-platform-req=php+' || '' }}
6356
# Bust the cache at least once a month - output format: YYYY-MM.
6457
custom-cache-suffix: $(date -u "+%Y-%m")
6558

.github/workflows/test.yml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,11 @@ jobs:
124124

125125
# Install dependencies and handle caching in one go.
126126
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
127-
- name: Install Composer dependencies - normal
128-
if: matrix.php != 'nightly'
127+
- name: Install Composer dependencies
129128
uses: "ramsey/composer-install@v3"
130129
with:
131-
# Bust the cache at least once a month - output format: YYYY-MM.
132-
custom-cache-suffix: $(date -u "+%Y-%m")
133-
134-
- name: Install Composer dependencies - ignore PHP restrictions
135-
if: matrix.php == 'nightly'
136-
uses: "ramsey/composer-install@v3"
137-
with:
138-
composer-options: --ignore-platform-req=php+
130+
# For PHP "nightly", we need to install with ignore platform reqs as not all dependencies may allow it yet.
131+
composer-options: ${{ matrix.php == 'nightly' && '--ignore-platform-req=php+' || '' }}
139132
# Bust the cache at least once a month - output format: YYYY-MM.
140133
custom-cache-suffix: $(date -u "+%Y-%m")
141134

@@ -312,19 +305,11 @@ jobs:
312305

313306
# Install dependencies and handle caching in one go.
314307
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
315-
- name: Install Composer dependencies - normal
316-
if: matrix.php != 'nightly'
317-
uses: "ramsey/composer-install@v3"
318-
with:
319-
composer-options: "--no-dev"
320-
# Bust the cache at least once a month - output format: YYYY-MM.
321-
custom-cache-suffix: $(date -u "+%Y-%m")
322-
323-
- name: Install Composer dependencies - ignore PHP restrictions
324-
if: matrix.php == 'nightly'
308+
- name: Install Composer dependencies
325309
uses: "ramsey/composer-install@v3"
326310
with:
327-
composer-options: "--no-dev --ignore-platform-req=php+"
311+
# For PHP "nightly", we need to install with ignore platform reqs as not all dependencies may allow it yet.
312+
composer-options: ${{ matrix.php == 'nightly' && '--no-dev --ignore-platform-req=php+' || '--no-dev' }}
328313
# Bust the cache at least once a month - output format: YYYY-MM.
329314
custom-cache-suffix: $(date -u "+%Y-%m")
330315

0 commit comments

Comments
 (0)