Skip to content

Commit

Permalink
Use ramsey/composer-install (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingimmick authored Mar 9, 2021
1 parent 7373a3d commit 5f42142
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v2.1.4
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd

- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction
uses: ramsey/composer-install@v1
with:
dependency-versions: "highest"

- name: Execute code standard tests
run: composer run-script lint
14 changes: 5 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,14 @@ jobs:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4, 8.0]
stability: [prefer-lowest, prefer-stable]
stability: [lowest, highest]

name: PHP ${{ matrix.php }} - ${{ matrix.stability }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v2.1.4
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ matrix.stability }}-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -39,7 +33,9 @@ jobs:
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
uses: ramsey/composer-install@v1
with:
dependency-versions: ${{ matrix.stability }}

- name: Execute tests
run: composer run-script test:phpunit -- --coverage-clover coverage.xml
Expand All @@ -55,4 +51,4 @@ jobs:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: ls
coverageLocations: ${{github.workspace}}/coverage.xml:clover
coverageLocations: ${{github.workspace}}/coverage.xml:clover

0 comments on commit 5f42142

Please sign in to comment.