Skip to content

Commit

Permalink
use a build matrix for php version so cache keys can be easily shared…
Browse files Browse the repository at this point in the history
… with other jobs
  • Loading branch information
bendavies committed May 5, 2020
1 parent 260d07f commit bc9d8ca
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ jobs:
name: "Static Analysis with Psalm"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

steps:
- name: "Checkout code"
uses: "actions/checkout@v2"
Expand All @@ -17,14 +22,14 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "7.4"
php-version: "${{ matrix.php-version }}"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "composer-${{ hashFiles('composer.lock') }}"
restore-keys: "composer-"
key: "${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"
Expand Down

0 comments on commit bc9d8ca

Please sign in to comment.