1- name : CI
1+ name : " CI "
22
33on :
44 push :
55 pull_request :
66
77jobs :
88 build :
9- runs-on : ${{ matrix.os }}
10- name : PHP v${{ matrix.php }} with MongoDB ${{ matrix.mongodb }} ${{ matrix.mode }}
9+ runs-on : " ${{ matrix.os }}"
10+ 11+ name : " PHP v${{ matrix.php }} with MongoDB ${{ matrix.mongodb }} ${{ matrix.mode }}"
12+ 1113 strategy :
1214 matrix :
1315 os :
14- - ubuntu-latest
16+ - " ubuntu-latest"
1517 mongodb :
16- - ' 4.4'
17- - ' 5.0'
18- - ' 6.0'
19- - ' 7.0'
18+ - " 4.4"
19+ - " 5.0"
20+ - " 6.0"
21+ - " 7.0"
2022 php :
21- - ' 8.1'
22- - ' 8.2'
23- - ' 8.3'
23+ - " 8.1"
24+ - " 8.2"
25+ - " 8.3"
2426 include :
25- - php : ' 8.1'
26- mongodb : ' 5.0'
27- mode : ' low-deps'
27+ - php : " 8.1"
28+ mongodb : " 5.0"
29+ mode : " low-deps"
2830
2931 steps :
30- - uses : actions/checkout@v4
31- - name : Create MongoDB Replica Set
32+ - uses : " actions/checkout@v4"
33+ 34+ - name : " Create MongoDB Replica Set"
3235 run : |
3336 docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongo:${{ matrix.mongodb }} mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5
3437
@@ -37,35 +40,43 @@ jobs:
3740 sleep 1
3841 done
3942 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\" }]})"
40- - name : Show MongoDB server status
43+
44+ - name : " Show MongoDB server status"
4145 run : |
4246 if [ "${{ matrix.mongodb }}" = "4.4" ]; then MONGOSH_BIN="mongo"; else MONGOSH_BIN="mongosh"; fi
4347 docker exec --tty mongodb $MONGOSH_BIN 127.0.0.1:27017 --eval "db.runCommand({ serverStatus: 1 })"
48+
4449 - name : " Installing php"
45- uses : shivammathur/setup-php@v2
50+ uses : " shivammathur/setup-php@v2"
4651 with :
4752 php-version : ${{ matrix.php }}
48- extensions : curl,mbstring,xdebug
49- coverage : xdebug
50- tools : composer
51- - name : Show PHP version
52- run : php -v && composer -V
53- - name : Show Docker version
54- run : if [[ "$DEBUG" == "true" ]]; then docker version && env; fi
55- env :
56- DEBUG : ${{ secrets.DEBUG }}
57- - name : Download Composer cache dependencies from cache
58- id : composer-cache
53+ extensions : " curl,mbstring,xdebug"
54+ coverage : " xdebug"
55+ tools : " composer"
56+ 57+ - name : " Show PHP version"
58+ if : ${{ secrets.DEBUG == 'true' }}
59+ run : " php -v && composer -V"
60+ 61+ - name : " Show Docker version"
62+ if : ${{ secrets.DEBUG == 'true' }}
63+ run : " docker version && env"
64+ 65+ - name : " Download Composer cache dependencies from cache"
66+ id : " composer-cache"
5967 run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
60- - name : Cache Composer dependencies
61- uses : actions/cache@v3
68+ 69+ - name : " Cache Composer dependencies"
70+ uses : " actions/cache@v3"
6271 with :
6372 path : ${{ steps.composer-cache.outputs.dir }}
64- key : ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }}
65- restore-keys : ${{ matrix.os }}-composer-
66- - name : Install dependencies
73+ key : " ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }}"
74+ restore-keys : " ${{ matrix.os }}-composer-"
75+ 76+ - name : " Install dependencies"
6777 run : composer update --no-interaction $([[ "${{ matrix.mode }}" == low-deps ]] && echo ' --prefer-lowest --prefer-stable')
68- - name : Run tests
69- run : ./vendor/bin/phpunit --coverage-clover coverage.xml
78+ 79+ - name : " Run tests"
80+ run : " ./vendor/bin/phpunit --coverage-clover coverage.xml"
7081 env :
7182 MONGODB_URI : ' mongodb://127.0.0.1/?replicaSet=rs'
0 commit comments