diff options
author | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2021-06-06 19:32:38 +0300 |
---|---|---|
committer | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2021-06-06 19:32:38 +0300 |
commit | 50e090eb23bd0180c976369c98b529716877a59b (patch) | |
tree | a625ebf961ee994d890e7ed553b0e20fb594f7dc /.github/workflows | |
parent | d5c710bf02f6a149b682df09f9dd661f28215949 (diff) |
Change Composer cache for Actions
https://github.com/actions/cache/blob/v2.1.6/examples.md#php---composer
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/lint-and-analyse-php.yml | 26 | ||||
-rw-r--r-- | .github/workflows/test-selenium.yml | 13 | ||||
-rw-r--r-- | .github/workflows/tests.yml | 39 |
3 files changed, 54 insertions, 24 deletions
diff --git a/.github/workflows/lint-and-analyse-php.yml b/.github/workflows/lint-and-analyse-php.yml index 3b7a403a0a..72814d8f11 100644 --- a/.github/workflows/lint-and-analyse-php.yml +++ b/.github/workflows/lint-and-analyse-php.yml @@ -45,11 +45,16 @@ jobs: php-version: 7.1 - name: Validate composer.json and composer.lock run: composer validate - - name: Cache module - uses: actions/cache@v2 + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 with: - path: ~/.composer/cache/ - key: composer-cache + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- - name: Cache coding-standard uses: actions/cache@v2 with: @@ -75,11 +80,16 @@ jobs: with: php-version: 7.2 extensions: mbstring, iconv, mysqli, zip, gd, bz2 - - name: Cache module - uses: actions/cache@v2 + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 with: - path: ~/.composer/cache/ - key: composer-cache + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- - name: Install dependencies run: composer install - name: Analyse files with phpstan diff --git a/.github/workflows/test-selenium.yml b/.github/workflows/test-selenium.yml index c04d8ab94f..fe44790cb6 100644 --- a/.github/workflows/test-selenium.yml +++ b/.github/workflows/test-selenium.yml @@ -65,11 +65,16 @@ jobs: with: php-version: ${{ matrix.php-version }} extensions: mbstring, iconv, mysqli, zip, gd, bz2 - - name: Cache module - uses: actions/cache@v2 + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 with: - path: ~/.composer/cache/ - key: composer-cache + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- - name: Install dependencies run: composer install --no-interaction - uses: actions/setup-node@v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 66a797e648..626e18cf4a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -80,11 +80,16 @@ jobs: php-version: ${{ matrix.php-version }} extensions: mbstring, iconv, mysqli, zip, gd, bz2 coverage: xdebug - - name: Cache module - uses: actions/cache@v2 + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 with: - path: ~/.composer/cache/ - key: composer-cache + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- - name: Install dependencies run: composer install --no-interaction ${{ matrix.composer-options }} - name: Run php tests @@ -129,11 +134,16 @@ jobs: php-version: ${{ matrix.php-version }} extensions: ${{ matrix.extension }}, mbstring, iconv, mysqli, zip, gd coverage: xdebug - - name: Cache module - uses: actions/cache@v2 + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 with: - path: ~/.composer/cache/ - key: composer-cache + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- - name: Install dependencies run: composer install - name: Run php tests @@ -176,11 +186,16 @@ jobs: with: php-version: ${{ matrix.php-version }} extensions: mbstring, iconv, mysqli, zip, gd, bz2 - - name: Cache module - uses: actions/cache@v2 + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 with: - path: ~/.composer/cache/ - key: composer-cache + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- - name: Install dependencies run: composer install - name: Run random php tests |