Skip to content

Commit 3b749d1

Browse files
authored
Merge pull request mongodb#1908 from Smolevich/add-improvements-for-ci
Refactor build-ci.yml
2 parents 811cb3d + 03de87d commit 3b749d1

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/build-ci.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-latest
11+
runs-on: ${{matrix.os}}
1212
strategy:
1313
matrix:
14-
php: [7.1, 7.2, 7.3]
14+
php: [7.1, 7.2, 7.3, 7.4]
15+
os: ['ubuntu-latest']
1516
services:
1617
mongo:
1718
image: mongo
@@ -25,18 +26,25 @@ jobs:
2526
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
2627
MYSQL_DATABASE: 'unittest'
2728
MYSQL_ROOT_PASSWORD:
29+
name: PHP ${{ matrix.php }} Test ${{ matrix.env }}
2830

2931
steps:
3032
- uses: actions/checkout@v1
3133
- name: Show php version
3234
run: php${{ matrix.php }} -v && composer -V
33-
- name: Show docker and docker-compose versions
34-
run: |
35-
docker version
3635
- name: Debug if needed
37-
run: if [[ "$DEBUG" == "true" ]]; then env; fi
36+
run: if [[ "$DEBUG" == "true" ]]; then docker version && env; fi
3837
env:
3938
DEBUG: ${{secrets.DEBUG}}
39+
- name: Get Composer Cache Directory
40+
id: composer-cache
41+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
42+
- name: Cache dependencies
43+
uses: actions/cache@v1
44+
with:
45+
path: ${{ steps.composer-cache.outputs.dir }}
46+
key: ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }}
47+
restore-keys: ${{ matrix.os }}-composer-
4048
- name: Install dependencies
4149
run: |
4250
composer install --no-interaction

0 commit comments

Comments
 (0)