Skip to content

Commit 972af53

Browse files
committed
Run tests directly on the OS
1 parent 4a7e461 commit 972af53

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,47 @@ jobs:
103103
env:
104104
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
105105
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}
106+
tests-directly-on-os:
107+
name: Run tests on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference (${{ matrix.os }})
108+
strategy:
109+
fail-fast: false
110+
matrix:
111+
os: [ubuntu-latest, windows-latest, macos-latest]
112+
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
113+
composer: [lowest, current, highest]
114+
needs:
115+
- lint-yaml
116+
- lint-json
117+
- composer-install
118+
- supported-checks-matrix
119+
- supported-versions-matrix
120+
runs-on: ubuntu-latest
121+
container:
122+
image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root
123+
steps:
124+
- uses: actions/checkout@v1
125+
- name: Cache composer packages
126+
uses: actions/cache@v1
127+
with:
128+
path: ./vendor/
129+
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
130+
- name: Install Dependencies
131+
run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o
132+
if: matrix.composer == 'lowest'
133+
- name: Install Dependencies
134+
run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o
135+
if: matrix.composer == 'current'
136+
- name: Install Dependencies
137+
run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o
138+
if: matrix.composer == 'highest'
139+
- name: Fetch Tags
140+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
141+
if: matrix.check == 'backward-compatibility-check'
142+
- run: |
143+
make unit-testing-raw mutation-testing-raw
144+
env:
145+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
146+
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}
106147
qodana:
107148
name: Qodana
108149
runs-on: ubuntu-latest
@@ -169,6 +210,7 @@ jobs:
169210
- lint-yaml
170211
- lint-json
171212
- qa
213+
- tests-directly-on-os
172214
- qodana
173215
runs-on: ubuntu-latest
174216
steps:

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,16 @@ unit-testing: ## Run tests
5252
$(DOCKER_RUN) vendor/bin/phpunit --colors=always -c ./etc/qa/phpunit.xml --coverage-text --coverage-html ./var/tests-unit-coverage-html --coverage-clover ./var/tests-unit-clover-coverage.xml
5353
$(DOCKER_RUN) test -n "$(COVERALLS_REPO_TOKEN)" && test -n "$(COVERALLS_RUN_LOCALLY)" && test -f ./var/tests-unit-clover-coverage.xml && vendor/bin/php-coveralls -v --coverage_clover ./build/logs/clover.xml --json_path ./var/tests-unit-clover-coverage-upload.json || true
5454

55+
unit-testing-raw: ## Run tests ###
56+
vendor/bin/phpunit --colors=always -c ./etc/qa/phpunit.xml --coverage-text --coverage-html ./var/tests-unit-coverage-html --coverage-clover ./var/tests-unit-clover-coverage.xml
57+
test -n "$(COVERALLS_REPO_TOKEN)" && test -n "$(COVERALLS_RUN_LOCALLY)" && test -f ./var/tests-unit-clover-coverage.xml && vendor/bin/php-coveralls -v --coverage_clover ./build/logs/clover.xml --json_path ./var/tests-unit-clover-coverage-upload.json || true
58+
5559
mutation-testing: ## Run mutation testing
5660
$(DOCKER_RUN) vendor/bin/roave-infection-static-analysis-plugin --ansi --min-msi=100 --min-covered-msi=100 --threads=$(THREADS) --ignore-msi-with-no-mutations || (cat ./var/infection.log && false)
5761

62+
mutation-testing-raw: ## Run mutation testing ###
63+
vendor/bin/roave-infection-static-analysis-plugin --ansi --min-msi=100 --min-covered-msi=100 --threads=$(THREADS) --ignore-msi-with-no-mutations || (cat ./var/infection.log && false)
64+
5865
composer-require-checker: ## Ensure we require every package used in this package directly
5966
$(DOCKER_RUN) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=./etc/qa/composer-require-checker.json
6067

0 commit comments

Comments
 (0)