Skip to content

Commit

Permalink
Merge pull request #512 from WyriHaximus/use-ramsey-composer-install-…
Browse files Browse the repository at this point in the history
…for-composer-install-and-caching-dependancies

Use ramsey/composer-install for install dependencies using composer
  • Loading branch information
WyriHaximus committed Dec 23, 2021
2 parents a7b2c5e + 2ea3d12 commit ed33994
Showing 1 changed file with 5 additions and 53 deletions.
58 changes: 5 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
runs-on: ubuntu-latest
needs:
- lint-yaml
- composer-install
outputs:
check: ${{ steps.supported-checks-matrix.outputs.check }}
steps:
Expand All @@ -36,67 +35,27 @@ jobs:
run: |
printf "Checks found: %s\r\n" $(make task-list-ci)
printf "::set-output name=check::%s" $(make task-list-ci)
composer-install:
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
composer: [lowest, current, highest]
needs:
- lint-yaml
- lint-json
- supported-versions-matrix
runs-on: ubuntu-latest
container:
image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root
steps:
- uses: actions/checkout@v1
- name: Cache composer packages
uses: actions/cache@v1
with:
path: ./vendor/
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
- name: Install Dependencies
run: composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o
if: matrix.composer == 'lowest'
- name: Install Dependencies
run: composer install --ansi --no-progress --no-interaction --prefer-dist -o
if: matrix.composer == 'current'
- name: Install Dependencies
run: composer update --ansi --no-progress --no-interaction --prefer-dist -o
if: matrix.composer == 'highest'
- run: mkdir ./vendor-archive/
- run: tar -zcf ./vendor-archive/vendor.tar.gz ./vendor
- name: Upload Composer Package Cache
uses: actions/upload-artifact@v2
with:
name: composer-cache-${{ matrix.composer }}-${{ matrix.php }}
path: ./vendor-archive/
qa:
name: Run ${{ matrix.check }} on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
composer: [lowest, current, highest]
composer: [lowest, locked, highest]
check: ${{ fromJson(needs.supported-checks-matrix.outputs.check) }}
needs:
- lint-yaml
- lint-json
- composer-install
- supported-checks-matrix
- supported-versions-matrix
runs-on: ubuntu-latest
container:
image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root
steps:
- uses: actions/checkout@v1
- name: Download Composer Package Cache
uses: actions/download-artifact@v2
- uses: ramsey/composer-install@v2
with:
name: composer-cache-${{ matrix.composer }}-${{ matrix.php }}
path: ./vendor-archive/
- run: tar zxf ./vendor-archive/vendor.tar.gz -C ./
dependency-versions: ${{ matrix.composer }}
- name: Fetch Tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
if: matrix.check == 'backward-compatibility-check'
Expand All @@ -115,21 +74,14 @@ jobs:
needs:
- lint-yaml
- lint-json
- composer-install
- supported-checks-matrix
- supported-versions-matrix
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Download Composer Package Cache
uses: actions/download-artifact@v2
- uses: ramsey/composer-install@v2
with:
name: composer-cache-${{ matrix.composer }}-${{ matrix.php }}
path: ./vendor-archive/
- run: tar zxf ./vendor-archive/vendor.tar.gz -C ./
- name: Fetch Tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
if: matrix.check == 'backward-compatibility-check'
dependency-versions: ${{ matrix.composer }}
- run: |
make unit-testing-raw
env:
Expand Down

0 comments on commit ed33994

Please sign in to comment.