19
19
20
20
env :
21
21
# All versions should be declared here
22
- PHALCON_VERSION : 5.0.2
22
+ PHALCON_VERSION : 5.6.0
23
23
24
24
# For tests
25
25
LANG : en_US.UTF-8
@@ -28,82 +28,134 @@ env:
28
28
29
29
# PHP extensions required by Composer
30
30
# (adding phalcon version here until I figure out how to use the variable above)
31
- EXTENSIONS : apcu, gettext, gd, igbinary, imagick, intl, json, mbstring, msgpack, memcached, phalcon-5.0.2, sqlite3, yaml, redis, :memcache
31
+ EXTENSIONS : apcu, phalcon-5.6.0
32
32
33
33
jobs :
34
- phpcs :
35
- name : Validate Tests code style
36
- if : " !contains(github.event.head_commit.message, 'ci skip')"
37
34
38
- runs-on : ubuntu-20.04
35
+ # Quality Tools
36
+ quality :
37
+ name : Quality Tests
38
+ runs-on : ubuntu-latest
39
+
40
+ permissions :
41
+ contents : read # to fetch code (actions/checkout)
42
+
39
43
steps :
40
- - uses : actions/checkout@v2
44
+ - uses : actions/checkout@v3
45
+ # - uses: php-actions/composer@v6
41
46
42
- - name : Run PHP_CodeSniffer
47
+ - name : Run PHP CodeSniffer
43
48
run : docker run --rm -v $(pwd):/data cytopia/phpcs --standard=./phpcs.xml
44
49
50
+ # - name: Get PHPStan PHAR
51
+ # run: |
52
+ # curl --silent -H "User-agent: cURL (https://github.com/php-actions)" -L \
53
+ # "https://www.getrelease.download/phpstan/phpstan/1.8.11/phar" > custom-phpstan.phar
54
+ #
55
+ # - name: Run PHPStan
56
+ # uses: php-actions/phpstan@v3
57
+ # with:
58
+ # php_version: 8.0
59
+ # path: src/
60
+ # vendored_phpstan_path: custom-phpstan.phar
61
+ # level: max
62
+ # autoload_file: ./vendor/autoload.php
63
+
64
+ # Running Tests
45
65
build-and-test :
46
66
name : tests / PHP-${{ matrix.php }}
47
-
48
67
runs-on : ubuntu-latest
68
+
69
+ permissions :
70
+ contents : read # to fetch code (actions/checkout)
71
+
49
72
strategy :
50
73
fail-fast : false
51
74
matrix :
52
- php : [ '7.4 ', '8.0 ', '8.1 ' ]
75
+ php : [ '8.0 ', '8.1 ', '8.2', '8.3 ' ]
53
76
54
77
steps :
55
- - uses : actions/checkout@v2
56
-
57
- - name : Setup platform specific environment
58
- shell : pwsh
59
- run : |
60
- git config --global core.autocrlf false
61
- $SessionSavePath = '/tmp'
62
- Write-Output "SESSION_SAVE_PATH=$SessionSavePath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
78
+ - uses : actions/checkout@v3
63
79
64
80
- name : Setup PHP
65
81
uses : shivammathur/setup-php@v2
66
82
with :
67
83
php-version : ${{ matrix.php }}
68
84
extensions : ${{ env.EXTENSIONS }}
69
85
ini-values : apc.enable_cli=on, session.save_path=${{ env.SESSION_SAVE_PATH }}
70
- tools : pecl, phpize, php-config, composer:v2
86
+ tools : pecl, composer:v2
71
87
coverage : xdebug
72
88
env :
73
89
COMPOSER_TOKEN : ${{ secrets.GITHUB_TOKEN }}
74
90
75
- - name : Validate composer
91
+ - name : " Validate composer"
76
92
run : composer validate --no-check-all --no-check-publish
77
93
78
- - name : Get Composer Cache Directory
79
- id : composer-cache
94
+ - name : " Install development dependencies with Composer"
95
+ uses : " ramsey/composer-install@v2"
96
+ with :
97
+ composer-options : " --prefer-dist"
98
+
99
+ - name : Run Unit Tests
100
+ if : always()
80
101
run : |
81
- echo "::set-output name=dir::$(composer config cache-files-dir)"
102
+ vendor/bin/phpunit tests/unit --testdox --process-isolation -v
103
+
104
+
105
+ # Qodana
106
+ qodana :
107
+ name : Qodana
108
+ runs-on : ubuntu-latest
109
+
110
+ permissions :
111
+ contents : write
112
+ pull-requests : write
113
+ checks : write
82
114
83
- - name : Setup Composer Cache
84
- uses : actions/cache@v2
115
+ steps :
116
+ - uses : actions/checkout@v3
85
117
with :
86
- path : ${{ steps.composer-cache.outputs.dir }}
87
- key : ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
88
- restore-keys : ${{ runner.os }}-composer-${{ matrix.php }}-
118
+ ref : ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
119
+ fetch-depth : 0 # a full history is required for pull request analysis
89
120
90
- - run : composer install --prefer-dist
121
+ - name : Setup PHP
122
+ uses : shivammathur/setup-php@v2
123
+ with :
124
+ php-version : 8.0
125
+ extensions : ${{ env.EXTENSIONS }}
126
+ ini-values : apc.enable_cli=on, session.save_path=${{ env.SESSION_SAVE_PATH }}
127
+ tools : pecl, composer:v2
128
+ coverage : xdebug
129
+ env :
130
+ COMPOSER_TOKEN : ${{ secrets.GITHUB_TOKEN }}
91
131
92
- - name : Setup Tests
93
- shell : bash
94
- run : |
95
- cp tests/_config/.env.default .env
96
- vendor/bin/codecept build
97
- # php tests/_config/generate-db-schemas.php
132
+ - name : " Validate composer"
133
+ run : composer validate --no-check-all --no-check-publish
134
+
135
+ - name : " Install development dependencies with Composer"
136
+ uses : " ramsey/composer-install@v2"
137
+ with :
138
+ composer-options : " --prefer-dist"
98
139
99
140
- name : Run Unit Tests
100
141
if : always()
101
- run : vendor/bin/codecept run --coverage-xml=coverage-${{ matrix.php }}.xml --ext DotReporter unit
142
+ run : |
143
+ vendor/bin/phpunit tests/unit \
144
+ --process-isolation \
145
+ -v \
146
+ --coverage-php tests/support/output/coverage.xml
102
147
103
- - name : Upload coverage to Codecov
104
- if : success()
105
- uses : codecov/codecov-action@v3
148
+ - name : ' Qodana Scan'
149
+
150
+ env :
151
+ QODANA_TOKEN : ${{ secrets.QODANA_TOKEN }}
106
152
with :
107
- token : ${{secrets.CODECOV_TOKEN}}
108
- directory : ./tests/_output/
109
- files : coverage-7.4.xml,coverage-8.0.xml,coverage-8.1.xml
153
+ args : --baseline,qodana.sarif.json
154
+
155
+ - name : " Upload to Qodana"
156
+ run : |
157
+ docker run \
158
+ -v $(pwd):/data/project/ \
159
+ -v ./tests/support/output/:/data/coverage \
160
+ -e QODANA_TOKEN="${{ secrets.QODANA_TOKEN }}" \
161
+ jetbrains/qodana-php
0 commit comments