-
-
Notifications
You must be signed in to change notification settings - Fork 466
119 lines (101 loc) · 3.55 KB
/
qodana.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Zephir CI
on:
schedule:
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 ${{ matrix.php }}
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
# variables_order: https://github.com/zephir-lang/zephir/pull/1537
# enable_dl: https://github.com/zephir-lang/zephir/pull/1654
# allow_url_fopen: https://github.com/zephir-lang/zephir/issues/1713
# error_reporting: https://github.com/zendframework/zend-code/issues/160
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:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Get composer cache directory
# id: composer-cache
# run: echo "::set-output name=dir::$(composer config cache-files-dir)"
# - name: Set Up Composer Cache
# uses: actions/cache@v3
# with:
# path: ${{ steps.composer-cache.outputs.dir }}
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
# restore-keys: ${{ runner.os }}-composer-
- 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/[email protected]
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