trying to fix qodana #4
This file contains 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
name: Qodana Analysis | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
- '**.txt' | |
- '**/nightly.yml' | |
- '**/release.yml' | |
- '**/FUNDING.yml' | |
env: | |
RE2C_VERSION: 2.2 | |
ZEPHIR_PARSER_VERSION: 1.6.0 | |
PSR_VERSION: 1.2.0 | |
CACHE_DIR: .cache | |
jobs: | |
qodana-analysis: | |
name: "Qodana analysis" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 5 | |
- name: Install PHP 8.0 | |
uses: shivammathur/setup-php@develop | |
with: | |
php-version: '8.0' | |
extensions: mbstring, fileinfo, gmp, sqlite, pdo_sqlite, psr-${{ env.PSR_VERSION }}, zip, mysqli, zephir_parser-${{ env.ZEPHIR_PARSER_VERSION }} | |
tools: phpize, php-config | |
coverage: xdebug | |
ini-values: >- | |
variables_order=EGPCS, | |
enable_dl=On, | |
allow_url_fopen=On, | |
error_reporting=-1, | |
memory_limit=1G, | |
date.timezone=UTC, | |
xdebug.max_nesting_level=256 | |
env: | |
phpts: 'ts' | |
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Project Dependencies | |
run: | | |
echo "::group::Install composer dependencies" | |
composer install --prefer-dist --no-interaction --no-ansi --no-progress | |
echo "::endgroup::" | |
- name: Fast Commands Test | |
run: php zephir --help | |
- name: Build Test Extension (Linux) | |
uses: ./.github/workflows/build-linux-ext | |
with: | |
compiler: 'gcc' | |
cflags: '-O2 -Wall -fvisibility=hidden -flto -DZEPHIR_RELEASE=1' | |
ldflags: '--coverage' | |
- name: Stub Extension Info | |
shell: pwsh | |
run: | | |
php --ini | |
php --ri stub | |
- name: Setup problem matchers for PHPUnit | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Unit Tests (Stub Extension) | |
shell: pwsh | |
run: | | |
php vendor/bin/phpunit -c phpunit.ext.xml --coverage-php ./tests/output/ext-clover.xml | |
- name: Unit Tests (Zephir) | |
if: always() | |
run: php vendor/bin/phpunit --testsuite Zephir --coverage-php ./tests/output/clover.xml | |
env: | |
XDEBUG_MODE: coverage | |
- name: Black-box Testing | |
if: always() && runner.os != 'Windows' | |
shell: bash | |
working-directory: tests/sharness | |
run: | | |
make -j$(getconf _NPROCESSORS_ONLN) | |
- name: 'Qodana Scan' | |
uses: JetBrains/qodana-action@v2023.2 | |
with: | |
args: --baseline,qodana.sarif.json | |
env: | |
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} | |
- name: "Upload to Qodana" | |
run: | | |
docker run \ | |
-v $(pwd):/data/project/ \ | |
-v ./tests/output/:/data/coverage \ | |
-e QODANA_TOKEN="${{ secrets.QODANA_TOKEN }}" \ | |
jetbrains/qodana-php |