Skip to content

Commit 2c7b2ed

Browse files
authored
Merge pull request #600: Refresh and simplify CI Workflows
2 parents d502782 + 86841b9 commit 2c7b2ed

File tree

4 files changed

+21
-87
lines changed

4 files changed

+21
-87
lines changed

.github/workflows/run-test-suite.yml

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
extensions-suffix: [ '', ', protobuf' ]
5454
dependencies: [ lowest , highest ]
5555
include:
56+
# Add Windows
5657
- os: windows-latest
5758
extensions-suffix: ', protobuf'
5859
php: 8.1
@@ -63,70 +64,32 @@ jobs:
6364
git config --global core.autocrlf false
6465
git config --global core.eol lf
6566
67+
- name: Check Out Code
68+
uses: actions/checkout@v4
69+
6670
- name: Setup PHP ${{ matrix.php }}
6771
uses: shivammathur/setup-php@v2
6872
with:
6973
php-version: ${{ matrix.php }}
70-
tools: composer:v2
7174
extensions: dom, sockets, grpc, curl ${{ matrix.extensions-suffix }}
72-
# extensions: dom, sockets, grpc, curl
73-
74-
- name: Check Out Code
75-
uses: actions/checkout@v4
76-
with:
77-
fetch-depth: 1
7875

7976
- name: Validate composer.json and composer.lock
8077
run: composer validate --strict
8178

82-
- name: Download CPX (PHP 8.4)
83-
if: inputs.download-binaries == true && matrix.php == '8.4'
84-
run: composer global require cpx/cpx
85-
86-
- name: Get Composer Cache Directory
87-
id: composer-cache
88-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
89-
90-
- name: Cache Composer Dependencies
91-
uses: actions/cache@v3
79+
- name: Install dependencies with composer
80+
uses: ramsey/composer-install@v3
9281
with:
93-
path: ${{ steps.composer-cache.outputs.dir }}
94-
key: php-${{ matrix.php }}-${{ matrix.os }}-composer-${{ hashFiles('**/composer.lock') }}
95-
restore-keys: |
96-
php-${{ matrix.php }}-${{ matrix.os }}-composer-
97-
98-
- name: Install lowest dependencies from composer.json
99-
if: matrix.dependencies == 'lowest' && matrix.php != '8.4'
100-
run: composer update --no-interaction --no-progress --prefer-lowest
101-
102-
- name: Install lowest dependencies from composer.json ignoring ext-php constraint (PHP 8.4)
103-
if: matrix.dependencies == 'lowest' && matrix.php == '8.4'
104-
run: composer update --no-interaction --no-progress --prefer-lowest --ignore-platform-req php
105-
82+
dependency-versions: ${{ matrix.dependencies }}
10683

10784
- name: Validate lowest dependencies
10885
if: matrix.dependencies == 'lowest' && matrix.php == '8.1'
10986
env:
11087
COMPOSER_POOL_OPTIMIZER: 0
11188
run: vendor/bin/validate-prefer-lowest
11289

113-
114-
- name: Install highest dependencies from composer.json
115-
if: matrix.dependencies == 'highest' && matrix.php != '8.4'
116-
run: composer update --no-interaction --no-progress
117-
118-
- name: Install highest dependencies from composer.json ignoring ext-php constraint (PHP 8.4)
119-
if: matrix.dependencies == 'highest' && matrix.php == '8.4'
120-
run: composer update --no-interaction --no-progress --ignore-platform-req php
121-
122-
12390
- name: Download binaries
124-
if: inputs.download-binaries == true && matrix.php != '8.4'
91+
if: inputs.download-binaries == true
12592
run: composer get:binaries
12693

127-
- name: Download binaries (PHP 8.4)
128-
if: inputs.download-binaries == true && matrix.php == '8.4'
129-
run: cpx internal/dload get --no-interaction
130-
13194
- name: Run tests
13295
run: ${{ inputs.test-command }}

.github/workflows/security-check.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,11 @@ jobs:
2525

2626
- name: Check Out Code
2727
uses: actions/checkout@v4
28-
with:
29-
fetch-depth: 1
30-
31-
- name: Get Composer Cache Directory
32-
id: composer-cache
33-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
3428

35-
- name: Cache Dependencies
36-
uses: actions/cache@v3
29+
- name: Install dependencies with composer
30+
uses: ramsey/composer-install@v3
3731
with:
38-
path: ${{ steps.composer-cache.outputs.dir }}
39-
key: php-${{ matrix.php }}-${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
40-
restore-keys: php-${{ matrix.php }}-${{ runner.os }}-composer-
41-
42-
- name: Install Composer Dependencies
43-
run: composer install --prefer-dist --no-interaction
32+
dependency-versions: ${{ matrix.dependencies }}
4433

4534
- name: Verify
4635
run: composer require --dev roave/security-advisories:dev-latest

.github/workflows/static-analysis.yml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,11 @@ jobs:
2525

2626
- name: Check Out Code
2727
uses: actions/checkout@v4
28-
with:
29-
fetch-depth: 1
30-
31-
- name: Get Composer Cache Directory
32-
id: composer-cache
33-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
3428

35-
- name: Cache Dependencies
36-
uses: actions/cache@v3
29+
- name: Install dependencies with composer
30+
uses: ramsey/composer-install@v3
3731
with:
38-
path: ${{ steps.composer-cache.outputs.dir }}
39-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
40-
restore-keys: php-${{ matrix.php }}-${{ runner.os }}-composer-
41-
42-
- name: Install Composer Dependencies
43-
run: composer install --prefer-dist --no-interaction
32+
dependency-versions: ${{ matrix.dependencies }}
4433

4534
- name: 🔍 Run Tests
4635
run: vendor/bin/psalm
@@ -66,19 +55,10 @@ jobs:
6655
with:
6756
fetch-depth: 1
6857

69-
- name: Get Composer Cache Directory
70-
id: composer-cache
71-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
72-
73-
- name: Cache Dependencies
74-
uses: actions/cache@v3
58+
- name: Install dependencies with composer
59+
uses: ramsey/composer-install@v3
7560
with:
76-
path: ${{ steps.composer-cache.outputs.dir }}
77-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
78-
restore-keys: php-${{ matrix.php }}-${{ runner.os }}-composer-
79-
80-
- name: Install Composer Dependencies
81-
run: composer install --prefer-dist --no-interaction
61+
dependency-versions: ${{ matrix.dependencies }}
8262

8363
- name: 🔍 Run Tests
8464
run: composer test:arch

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@
8282
"buggregator/trap": "For better debugging"
8383
},
8484
"scripts": {
85-
"post-update-cmd": "Temporal\\Worker\\Transport\\RoadRunnerVersionChecker::postUpdate",
86-
"get:binaries": "dload get --no-interaction -vv",
85+
"get:binaries": [
86+
"dload get --no-interaction -vv",
87+
"Temporal\\Worker\\Transport\\RoadRunnerVersionChecker::postUpdate"
88+
],
8789
"cs:diff": "php-cs-fixer fix --dry-run -v --diff --show-progress dots",
8890
"cs:fix": "php-cs-fixer fix -v",
8991
"psalm": "psalm",

0 commit comments

Comments
 (0)