@@ -92,20 +92,55 @@ jobs:
92
92
needs : test
93
93
if : success()
94
94
runs-on : ubuntu-latest
95
+ env :
96
+ extensions : curl,json,mbstring,uopz
97
+ key : cache-v1 # can be any string, change to clear the extension cache.
98
+ strategy :
99
+ matrix :
100
+ php-versions : ['8.1']
95
101
steps :
96
102
- name : Checkout
97
103
uses : actions/checkout@v2
98
104
105
+ - name : Setup cache environment
106
+ id : extcache
107
+ uses : shivammathur/cache-extensions@v1
108
+ with :
109
+ php-version : ${{ matrix.php-versions }}
110
+ extensions : ${{ env.extensions }}
111
+ key : ${{ env.key }}
112
+
113
+ - name : Cache extensions
114
+ uses : actions/cache@v2
115
+ with :
116
+ path : ${{ steps.extcache.outputs.dir }}
117
+ key : ${{ steps.extcache.outputs.key }}
118
+ restore-keys : ${{ steps.extcache.outputs.key }}
119
+
99
120
- name : Setup PHP
100
121
uses : shivammathur/setup-php@v2
101
122
with :
102
- php-version : 8.0
123
+ php-version : ${{ matrix.php-versions }}
124
+ extensions : ${{ env.extensions }}
103
125
coverage : pcov
104
- extensions : curl,json,mbstring,uopz
105
126
tools : pecl,phpunit
106
127
107
- - name : Install Composer deps
108
- run : composer update --no-interaction --no-suggest
128
+ - name : Get Composer Cache Directory
129
+ id : composer-cache
130
+ run : echo "::set-output name=dir::$(composer config cache-files-dir)"
131
+
132
+ - name : Cache dependencies
133
+ uses : actions/cache@v2
134
+ with :
135
+ path : ${{ steps.composer-cache.outputs.dir }}
136
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
137
+ restore-keys : ${{ runner.os }}-composer-
138
+
139
+ - name : Validate composer.json and composer.lock
140
+ run : composer validate
141
+
142
+ - name : Install dependencies
143
+ run : composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs
109
144
110
145
- name : Run test suite
111
146
run : ./vendor/phpunit/phpunit/phpunit --configuration tests/phpunit.xml --exclude-group twig --coverage-clover=./var/coverage/clover.xml
0 commit comments