Skip to content

Commit efa0bb6

Browse files
committed
update workflows to use $GITHUB_OUTPUT
1 parent fc44bb3 commit efa0bb6

File tree

9 files changed

+44
-33
lines changed

9 files changed

+44
-33
lines changed

.github/workflows/deploy-distributables.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@ jobs:
2121
fetch-depth: 0 # fetch all tags
2222

2323
- name: Get latest version
24+
id: version
2425
run: |
25-
echo 'LATEST_VERSION<<EOF' >> $GITHUB_ENV
26-
echo $(git describe --tags --abbrev=0) | sed "s/v//" >> $GITHUB_ENV
27-
echo 'EOF' >> $GITHUB_ENV
26+
echo 'LATEST_VERSION<<EOF' >> $GITHUB_OUTPUT
27+
echo $(git describe --tags --abbrev=0) | sed "s/v//" >> $GITHUB_OUTPUT
28+
echo 'EOF' >> $GITHUB_OUTPUT
2829
2930
- name: Search for updated version
30-
if: ${{ env.LATEST_VERSION }}
31+
if: ${{ steps.version.outputs.LATEST_VERSION }}
3132
run: |
3233
chmod +x ${GITHUB_WORKSPACE}/.github/scripts/validate-version
33-
${GITHUB_WORKSPACE}/.github/scripts/validate-version ${{ env.LATEST_VERSION }}
34+
${GITHUB_WORKSPACE}/.github/scripts/validate-version ${{ steps.version.outputs.LATEST_VERSION }}
3435
3536
framework:
3637
name: Deploy to framework

.github/workflows/reusable-coveralls.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ jobs:
3939
working-directory: build/cov
4040

4141
- name: Get composer cache directory
42+
id: composer-cache
4243
run: |
43-
echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
44+
echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
4445
4546
- name: Cache dependencies
4647
uses: actions/cache@v5
4748
with:
48-
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
49+
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
4950
key: ${{ github.job }}-php-${{ inputs.php-version }}-${{ hashFiles('**/composer.*') }}
5051
restore-keys: |
5152
${{ github.job }}-php-${{ inputs.php-version }}-

.github/workflows/reusable-phpunit-test.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,15 @@ jobs:
173173
COVERAGE_DRIVER: ${{ inputs.enable-coverage && 'xdebug' || 'none' }}
174174

175175
- name: Setup global environment variables
176+
id: setup-env
176177
run: |
177-
echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
178-
echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}${{ inputs.mysql-version || '' }}" >> $GITHUB_ENV
178+
echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
179+
echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}${{ inputs.mysql-version || '' }}" >> $GITHUB_OUTPUT
179180
180181
- name: Cache dependencies
181182
uses: actions/cache@v5
182183
with:
183-
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
184+
path: ${{ steps.setup-env.outputs.COMPOSER_CACHE_FILES_DIR }}
184185
key: ${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}-${{ hashFiles('**/composer.*') }}
185186
restore-keys: |
186187
${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}-
@@ -202,14 +203,15 @@ jobs:
202203
composer update --ansi ${{ inputs.extra-composer-options }}
203204
204205
- name: Compute additional PHPUnit options
206+
id: phpunit-options
205207
run: |
206-
echo "EXTRA_PHPUNIT_OPTIONS=${{ format('{0} {1} {2}', env.GROUP_OPTION, env.COVERAGE_OPTION, inputs.extra-phpunit-options) }}" >> $GITHUB_ENV
208+
echo "EXTRA_PHPUNIT_OPTIONS=${{ format('{0} {1} {2}', env.GROUP_OPTION, env.COVERAGE_OPTION, inputs.extra-phpunit-options) }}" >> $GITHUB_OUTPUT
207209
env:
208-
COVERAGE_OPTION: ${{ inputs.enable-coverage && format('--coverage-php build/cov/coverage-{0}.cov', env.ARTIFACT_NAME) || '--no-coverage' }}
210+
COVERAGE_OPTION: ${{ inputs.enable-coverage && format('--coverage-php build/cov/coverage-{0}.cov', steps.setup-env.outputs.ARTIFACT_NAME) || '--no-coverage' }}
209211
GROUP_OPTION: ${{ inputs.group-name && format('--group {0}', inputs.group-name) || '' }}
210212

211213
- name: Run tests
212-
run: script -e -c "vendor/bin/phpunit --color=always ${{ env.EXTRA_PHPUNIT_OPTIONS }}"
214+
run: script -e -c "vendor/bin/phpunit --color=always ${{ steps.phpunit-options.outputs.EXTRA_PHPUNIT_OPTIONS }}"
213215
env:
214216
DB: ${{ inputs.db-platform }}
215217
TACHYCARDIA_MONITOR_GA: ${{ inputs.enable-profiling && 'enabled' || '' }}
@@ -220,7 +222,7 @@ jobs:
220222
if: ${{ inputs.enable-artifact-upload }}
221223
uses: actions/upload-artifact@v6
222224
with:
223-
name: ${{ env.ARTIFACT_NAME }}
224-
path: build/cov/coverage-${{ env.ARTIFACT_NAME }}.cov
225+
name: ${{ steps.setup-env.outputs.ARTIFACT_NAME }}
226+
path: build/cov/coverage-${{ steps.setup-env.outputs.ARTIFACT_NAME }}.cov
225227
if-no-files-found: error
226228
retention-days: 1

.github/workflows/reusable-serviceless-phpunit-test.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,15 @@ jobs:
8585
COVERAGE_DRIVER: ${{ inputs.enable-coverage && 'xdebug' || 'none' }}
8686

8787
- name: Setup global environment variables
88+
id: setup-env
8889
run: |
89-
echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
90-
echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}" >> $GITHUB_ENV
90+
echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
91+
echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}" >> $GITHUB_OUTPUT
9192
9293
- name: Cache Composer dependencies
9394
uses: actions/cache@v5
9495
with:
95-
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
96+
path: ${{ steps.setup-env.outputs.COMPOSER_CACHE_FILES_DIR }}
9697
key: ${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-${{ hashFiles('**/composer.*') }}
9798
restore-keys: |
9899
${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-
@@ -113,14 +114,15 @@ jobs:
113114
composer update --ansi ${{ inputs.extra-composer-options }}
114115
115116
- name: Compute additional PHPUnit options
117+
id: phpunit-options
116118
run: |
117-
echo "EXTRA_PHPUNIT_OPTIONS=${{ format('{0} {1} {2}', env.GROUP_OPTION, env.COVERAGE_OPTION, inputs.extra-phpunit-options) }}" >> $GITHUB_ENV
119+
echo "EXTRA_PHPUNIT_OPTIONS=${{ format('{0} {1} {2}', env.GROUP_OPTION, env.COVERAGE_OPTION, inputs.extra-phpunit-options) }}" >> $GITHUB_OUTPUT
118120
env:
119-
COVERAGE_OPTION: ${{ inputs.enable-coverage && format('--coverage-php build/cov/coverage-{0}.cov', env.ARTIFACT_NAME) || '--no-coverage' }}
121+
COVERAGE_OPTION: ${{ inputs.enable-coverage && format('--coverage-php build/cov/coverage-{0}.cov', steps.setup-env.outputs.ARTIFACT_NAME) || '--no-coverage' }}
120122
GROUP_OPTION: ${{ inputs.group-name && format('--group {0}', inputs.group-name) || '' }}
121123

122124
- name: Run tests
123-
run: script -e -c "vendor/bin/phpunit --color=always ${{ env.EXTRA_PHPUNIT_OPTIONS }}"
125+
run: script -e -c "vendor/bin/phpunit --color=always ${{ steps.phpunit-options.outputs.EXTRA_PHPUNIT_OPTIONS }}"
124126
env:
125127
TACHYCARDIA_MONITOR_GA: ${{ inputs.enable-profiling && 'enabled' || '' }}
126128
TERM: xterm-256color
@@ -129,7 +131,7 @@ jobs:
129131
if: ${{ inputs.enable-artifact-upload }}
130132
uses: actions/upload-artifact@v6
131133
with:
132-
name: ${{ env.ARTIFACT_NAME }}
133-
path: build/cov/coverage-${{ env.ARTIFACT_NAME }}.cov
134+
name: ${{ steps.setup-env.outputs.ARTIFACT_NAME }}
135+
path: build/cov/coverage-${{ steps.setup-env.outputs.ARTIFACT_NAME }}.cov
134136
if-no-files-found: error
135137
retention-days: 1

.github/workflows/test-coding-standards.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ jobs:
5151
coverage: none
5252

5353
- name: Get composer cache directory
54-
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
54+
id: composer-cache
55+
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
5556

5657
- name: Cache dependencies
5758
uses: actions/cache@v5
5859
with:
59-
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
60+
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
6061
key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
6162
restore-keys: |
6263
${{ runner.os }}-${{ matrix.php-version }}-

.github/workflows/test-deptrac.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ jobs:
5656
run: composer validate --strict
5757

5858
- name: Get composer cache directory
59-
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
59+
id: composer-cache
60+
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6061

6162
- name: Cache dependencies
6263
uses: actions/cache@v5
6364
with:
64-
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
65+
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
6566
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
6667
restore-keys: ${{ runner.os }}-composer-
6768

.github/workflows/test-phpstan.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,13 @@ jobs:
6868
run: composer validate --strict
6969

7070
- name: Get composer cache directory
71-
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
71+
id: composer-cache
72+
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
7273

7374
- name: Cache dependencies
7475
uses: actions/cache@v5
7576
with:
76-
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
77+
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
7778
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
7879
restore-keys: ${{ runner.os }}-composer-
7980

.github/workflows/test-psalm.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ jobs:
5151
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5252

5353
- name: Get composer cache directory
54-
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
54+
id: composer-cache
55+
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
5556

5657
- name: Cache composer dependencies
5758
uses: actions/cache@v5
5859
with:
59-
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
60+
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
6061
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
6162
restore-keys: ${{ runner.os }}-composer-
6263

.github/workflows/test-rector.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@ jobs:
7474
run: composer validate --strict
7575

7676
- name: Get composer cache directory
77-
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
77+
id: composer-cache
78+
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
7879

7980
- name: Cache dependencies
8081
uses: actions/cache@v5
8182
with:
82-
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
83+
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
8384
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
8485
restore-keys: ${{ runner.os }}-composer-
8586

0 commit comments

Comments
 (0)