Skip to content

Commit

Permalink
[minor] Streamline GitHub CI by using ramsey/composer-install (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbond authored Dec 9, 2020
1 parent 40677dd commit b775669
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 35 deletions.
61 changes: 27 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,19 @@ jobs:
php-version: ${{ matrix.php }}
coverage: none

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-${{ matrix.php }}-${{ matrix.symfony }}-${{ hashFiles('composer.json') }}
- name: Install Symfony Flex
run: composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-main

- name: Install dependencies
run: |
composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-main
composer update --prefer-dist --no-interaction --no-suggest
vendor/bin/simple-phpunit install
uses: ramsey/composer-install@v1
with:
composer-options: --prefer-dist
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}

- name: Install PHPUnit
run: vendor/bin/simple-phpunit install

- name: Run tests
run: vendor/bin/simple-phpunit -v

Expand All @@ -60,16 +59,14 @@ jobs:
php-version: 7.2
coverage: none

- name: Cache dependencies
uses: actions/cache@v1
- name: Install dependencies
uses: ramsey/composer-install@v1
with:
path: ~/.composer/cache/files
key: prefer-lowest-${{ hashFiles('composer.json') }}
dependency-versions: lowest
composer-options: --prefer-dist

- name: Install dependencies
run: |
composer update --prefer-lowest --prefer-dist --no-interaction --no-suggest
vendor/bin/simple-phpunit install
- name: Install PHPUnit
run: vendor/bin/simple-phpunit install

- name: Run tests
run: vendor/bin/simple-phpunit -v
Expand All @@ -89,17 +86,16 @@ jobs:
php-version: 7.4
coverage: none

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dev-master-${{ hashFiles('composer.json') }}
- name: Configure composer
run: composer config minimum-stability dev

- name: Install dependencies
run: |
composer config minimum-stability dev
composer update --prefer-dist --no-interaction --no-suggest
vendor/bin/simple-phpunit install
uses: ramsey/composer-install@v1
with:
composer-options: --prefer-dist

- name: Install PHPUnit
run: vendor/bin/simple-phpunit install

- name: Run tests
run: vendor/bin/simple-phpunit -v
Expand All @@ -117,16 +113,13 @@ jobs:
php-version: 7.4
coverage: xdebug

- name: Cache dependencies
uses: actions/cache@v1
- name: Install dependencies
uses: ramsey/composer-install@v1
with:
path: ~/.composer/cache/files
key: coverage-${{ hashFiles('composer.json') }}
composer-options: --prefer-dist

- name: Install dependencies
run: |
composer update --prefer-dist --no-interaction --no-suggest
vendor/bin/simple-phpunit install
- name: Install PHPUnit
run: vendor/bin/simple-phpunit install

- name: Run code coverage
run: vendor/bin/simple-phpunit -v --coverage-text --coverage-clover=coverage.clover
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"symfony/lock": "^4.4|^5.0",
"symfony/mailer": "^4.4|^5.0",
"symfony/messenger": "^4.4|^5.0",
"symfony/phpunit-bridge": "^5.1.8",
"symfony/phpunit-bridge": "^5.2",
"symfony/process": "^4.2|^5.0"
},
"suggest": {
Expand Down

0 comments on commit b775669

Please sign in to comment.