Skip to content

Commit

Permalink
Test lowest dependencies in CI (#2113)
Browse files Browse the repository at this point in the history
* Simplify GA using composer-install

* Bump elasticsearch/elasticsearch to 7.10

Co-authored-by: Nicolas Ruflin <spam@ruflin.com>
  • Loading branch information
franmomu and ruflin committed Aug 15, 2022
1 parent 1a2db5f commit 535fb09
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 32 deletions.
45 changes: 14 additions & 31 deletions .github/workflows/continuous-integration.yaml
Expand Up @@ -36,8 +36,15 @@ jobs:
- '7.4'
- '8.0'
- '8.1'
dependencies:
- 'highest'
elasticsearch:
- '7.15.2'
include:
# Test with the lowest set of dependencies
- dependencies: 'lowest'
php: '7.2'
elasticsearch: '7.15.2'
fail-fast: false
steps:
- name: 'Checkout'
Expand All @@ -51,23 +58,11 @@ jobs:
tools: 'pecl, composer:v2'
extensions: 'curl, json, mbstring, openssl'

- name: 'Get composer cache directory'
id: 'composer_cache'
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: 'Cache dependencies'
uses: 'actions/cache@v2'
- name: 'Install dependencies with Composer'
uses: 'ramsey/composer-install@v2'
with:
path: '${{ steps.composer_cache.outputs.dir }}'
key: '${{ runner.os }}-composer-php${{ matrix.php }}-${{ hashFiles(''**/composer.json'') }}'
restore-keys: |
${{ runner.os }}-composer-php${{ matrix.php }}-
${{ runner.os }}-composer-
- name: 'Update dependencies'
run: |
composer update --prefer-dist --no-interaction --no-progress --ansi ${{ matrix.composer_flags }}
dependency-versions: '${{ matrix.dependencies }}'
composer-options: '--prefer-dist'

- name: 'Run unit tests'
run: |
Expand Down Expand Up @@ -115,23 +110,11 @@ jobs:
tools: 'pecl, composer:v2'
extensions: 'curl, json, mbstring, openssl'

- name: 'Get composer cache directory'
id: 'composer_cache'
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: 'Cache dependencies'
uses: 'actions/cache@v2'
- name: 'Install dependencies with Composer'
uses: 'ramsey/composer-install@v2'
with:
path: '${{ steps.composer_cache.outputs.dir }}'
key: '${{ runner.os }}-composer-php${{ matrix.php }}-${{ hashFiles(''**/composer.json'') }}'
restore-keys: |
${{ runner.os }}-composer-php${{ matrix.php }}-
${{ runner.os }}-composer-
- name: 'Update dependencies'
run: |
composer update --prefer-dist --no-interaction --no-progress --ansi ${{ matrix.composer_flags }}
composer-options: '--prefer-dist'

- name: 'Run phpstan'
run: |
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Backward Compatibility Breaks
### Added
### Changed
* Use `ramsey/composer-install` to simplify CI jobs and test with the lowest set of dependencies [#2113](https://github.com/ruflin/Elastica/pull/2113)
* Bumped `elasticsearch/elasticsearch` to `7.10` to be able to use `OpenPointInTime` class [#2113](https://github.com/ruflin/Elastica/pull/2113)
* Updated `php-cs-fixer` to `3.9.5` [#2110](https://github.com/ruflin/Elastica/pull/2110)
### Deprecated
### Removed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -17,7 +17,7 @@
"require": {
"php": "^7.2 || ^8.0",
"ext-json": "*",
"elasticsearch/elasticsearch": "^7.1.1",
"elasticsearch/elasticsearch": "^7.10",
"nyholm/dsn": "^2.0.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0",
Expand Down

0 comments on commit 535fb09

Please sign in to comment.