-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Update docker and test configs #2678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
37cacb9
scripts added to composer;
hans-thomas 7cf995d
Docker configuration updated;
hans-thomas c71c2ec
Update Dockerfile
hans-thomas 10e1646
Reformat build-ci;
hans-thomas a35d382
Remove double quotes;
hans-thomas ff1c906
Two new scripts;
hans-thomas b00e350
Update build-ci.yml
hans-thomas 56beea9
Update Dockerfile
hans-thomas 288b78d
Double quotes workflows values;
hans-thomas 1ec3ec2
Merge branch '4.1' into update-structure
hans-thomas 038df43
Update copying php.ini file;
hans-thomas 574deb0
test:group script removed;
hans-thomas 68d79e4
Merge creating php.ini and enabling coverage mode;
hans-thomas 2b4a0cb
Revert composer installation command;
hans-thomas 4881f6b
WIP
hans-thomas 8a36ebc
debug steps updated;
hans-thomas 81e0d24
Set xdebug.mode in phpunit config, default container command to insta…
GromNaN 45f8069
Merge branch '4.1' into update-structure
GromNaN b3c78f2
Update doc
GromNaN File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,37 @@ | ||
name: CI | ||
name: "CI" | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
name: PHP v${{ matrix.php }} with MongoDB ${{ matrix.mongodb }} ${{ matrix.mode }} | ||
runs-on: "${{ matrix.os }}" | ||
|
||
name: "PHP v${{ matrix.php }} with MongoDB ${{ matrix.mongodb }} ${{ matrix.mode }}" | ||
|
||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- "ubuntu-latest" | ||
mongodb: | ||
- '4.4' | ||
- '5.0' | ||
- '6.0' | ||
- '7.0' | ||
- "4.4" | ||
- "5.0" | ||
- "6.0" | ||
- "7.0" | ||
php: | ||
- '8.1' | ||
- '8.2' | ||
- '8.3' | ||
- "8.1" | ||
- "8.2" | ||
- "8.3" | ||
include: | ||
- php: '8.1' | ||
mongodb: '5.0' | ||
mode: 'low-deps' | ||
- php: "8.1" | ||
mongodb: "5.0" | ||
mode: "low-deps" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create MongoDB Replica Set | ||
- uses: "actions/checkout@v4" | ||
|
||
- name: "Create MongoDB Replica Set" | ||
run: | | ||
docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongo:${{ matrix.mongodb }} mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5 | ||
|
||
|
@@ -37,35 +40,43 @@ jobs: | |
sleep 1 | ||
done | ||
sudo docker exec --tty mongodb $MONGOSH_BIN 127.0.0.1:27017 --eval "rs.initiate({\"_id\":\"rs\",\"members\":[{\"_id\":0,\"host\":\"127.0.0.1:27017\" }]})" | ||
- name: Show MongoDB server status | ||
|
||
- name: "Show MongoDB server status" | ||
run: | | ||
if [ "${{ matrix.mongodb }}" = "4.4" ]; then MONGOSH_BIN="mongo"; else MONGOSH_BIN="mongosh"; fi | ||
docker exec --tty mongodb $MONGOSH_BIN 127.0.0.1:27017 --eval "db.runCommand({ serverStatus: 1 })" | ||
|
||
- name: "Installing php" | ||
uses: shivammathur/setup-php@v2 | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: curl,mbstring,xdebug | ||
coverage: xdebug | ||
tools: composer | ||
- name: Show PHP version | ||
run: php -v && composer -V | ||
- name: Show Docker version | ||
run: if [[ "$DEBUG" == "true" ]]; then docker version && env; fi | ||
env: | ||
DEBUG: ${{ secrets.DEBUG }} | ||
- name: Download Composer cache dependencies from cache | ||
id: composer-cache | ||
extensions: "curl,mbstring,xdebug" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not related to the changes, as those are CS changes. From the action-runners docs/readme
Does this get overridden with setting the extensions manually? |
||
coverage: "xdebug" | ||
tools: "composer" | ||
|
||
- name: "Show PHP version" | ||
if: ${{ secrets.DEBUG == 'true' }} | ||
run: "php -v && composer -V" | ||
|
||
- name: "Show Docker version" | ||
if: ${{ secrets.DEBUG == 'true' }} | ||
run: "docker version && env" | ||
|
||
- name: "Download Composer cache dependencies from cache" | ||
id: "composer-cache" | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
- name: Cache Composer dependencies | ||
uses: actions/cache@v3 | ||
|
||
- name: "Cache Composer dependencies" | ||
uses: "actions/cache@v3" | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ matrix.os }}-composer- | ||
- name: Install dependencies | ||
key: "${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }}" | ||
restore-keys: "${{ matrix.os }}-composer-" | ||
|
||
- name: "Install dependencies" | ||
run: composer update --no-interaction $([[ "${{ matrix.mode }}" == low-deps ]] && echo ' --prefer-lowest --prefer-stable') | ||
- name: Run tests | ||
run: ./vendor/bin/phpunit --coverage-clover coverage.xml | ||
|
||
- name: "Run tests" | ||
run: "./vendor/bin/phpunit --coverage-clover coverage.xml" | ||
env: | ||
MONGODB_URI: 'mongodb://127.0.0.1/?replicaSet=rs' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this change is based on a comment in another PR, but I wonder if it belongs in this PR. As in my eyes it is a code style thing, which adds a lot of noise to the PR. Personally I would create a separate PR to add these changes.
Though personally I don't see a benefit to these changes, but that's me and the project style is leading.