diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e5ada6d..29992817 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,6 +103,47 @@ jobs: env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }} + tests-directly-on-os: + name: Run tests on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference (${{ matrix.os }}) + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} + composer: [lowest, current, highest] + needs: + - lint-yaml + - lint-json + - composer-install + - supported-checks-matrix + - supported-versions-matrix + runs-on: ubuntu-latest + container: + image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root + steps: + - uses: actions/checkout@v1 + - name: Cache composer packages + uses: actions/cache@v1 + with: + path: ./vendor/ + key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} + - name: Install Dependencies + run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o + if: matrix.composer == 'lowest' + - name: Install Dependencies + run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o + if: matrix.composer == 'current' + - name: Install Dependencies + run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o + if: matrix.composer == 'highest' + - name: Fetch Tags + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true + if: matrix.check == 'backward-compatibility-check' + - run: | + make unit-testing-raw mutation-testing-raw + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }} qodana: name: Qodana runs-on: ubuntu-latest @@ -169,6 +210,7 @@ jobs: - lint-yaml - lint-json - qa + - tests-directly-on-os - qodana runs-on: ubuntu-latest steps: diff --git a/Makefile b/Makefile index 1a71ce11..7f317515 100644 --- a/Makefile +++ b/Makefile @@ -52,9 +52,16 @@ unit-testing: ## Run tests $(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 $(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 +unit-testing-raw: ## Run tests ### + 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 + 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 + mutation-testing: ## Run mutation testing $(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) +mutation-testing-raw: ## Run mutation testing ### + 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) + composer-require-checker: ## Ensure we require every package used in this package directly $(DOCKER_RUN) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=./etc/qa/composer-require-checker.json