Skip to content

Commit 21be7a3

Browse files
committed
fix(test): Fixed issue with CI and psalm
1 parent 2dc9881 commit 21be7a3

File tree

5 files changed

+25
-18
lines changed

5 files changed

+25
-18
lines changed

.github/workflows/ci.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Run CI build script
22

33
on:
4-
workflow_call:
4+
workflow_call:
55
pull_request:
66
types: [ opened, reopened, edited, synchronize ]
77
branches:
@@ -17,6 +17,9 @@ jobs:
1717
with:
1818
ref: ${{ github.event.pull_request.head.sha }}
1919

20+
- name: Mark repository as safe
21+
run: git config --global --add safe.directory $GITHUB_WORKSPACE
22+
2023
- name: Setup python
2124
uses: actions/setup-python@v4
2225
id: setup-python
@@ -34,11 +37,13 @@ jobs:
3437
run: |
3538
pipenv install
3639
pipenv run python bin/ci.py --verbose --teardown
37-
38-
- name: Upload Scrutinizer coverage
39-
uses: sudo-bot/action-scrutinizer@latest
40+
env:
41+
COMPOSER_ROOT_VERSION: ${{ vars.COMPOSER_ROOT_VERSION }}
42+
43+
- name: Upload Scrutinizer coverage
44+
uses: sudo-bot/action-scrutinizer@latest
4045
# Do not run this step on forked versions of the main repository (example: contributor forks)
41-
if: github.repository == 'runopencode/query-resources-loader-bundle'
42-
with:
43-
cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
46+
if: github.repository == 'runopencode/query-resources-loader-bundle'
47+
with:
48+
cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
4449

.github/workflows/release.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626
uses: actions/checkout@v4
2727
with:
2828
fetch-depth: 0
29+
30+
- name: Mark repository as safe
31+
run: git config --global --add safe.directory $GITHUB_WORKSPACE
32+
2933
- name: Setup Node.js
3034
uses: actions/setup-node@v4
3135
with:
@@ -34,6 +38,6 @@ jobs:
3438
run: npm clean-install
3539
- name: Release
3640
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
3842
run: npx semantic-release
3943

bin/ci.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ def ci(verbose, install, teardown):
3232
commands = {
3333
'composer install': ('XDEBUG_MODE=off composer install', False),
3434
'composer run phpunit': ('XDEBUG_MODE=coverage composer run phpunit', False),
35-
'composer run php-cs-fixer': ('composer run php-cs-fixer', False),
36-
'composer run phpmd': ('composer run phpmd', False),
37-
'composer run phpstan': ('composer run phpstan', False),
38-
'composer run psalm': ('composer run psalm', False),
39-
'composer run composer-require-checker': ('composer run composer-require-checker', False),
40-
'composer run composer-unused': ('composer run composer-unused', False)
35+
'composer run php-cs-fixer': ('XDEBUG_MODE=off composer run php-cs-fixer', False),
36+
'composer run phpmd': ('XDEBUG_MODE=off composer run phpmd', False),
37+
'composer run phpstan': ('XDEBUG_MODE=off composer run phpstan', False),
38+
'composer run psalm': ('XDEBUG_MODE=off composer run psalm', False),
39+
'composer run composer-require-checker': ('XDEBUG_MODE=off composer run composer-require-checker', False),
40+
'composer run composer-unused': ('XDEBUG_MODE=off composer run composer-unused', False)
4141
}
4242

4343
if not install:

psalm.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@
3737

3838
<plugins>
3939
<pluginClass class="Psalm\SymfonyPsalmPlugin\Plugin">
40-
<containerXml>
41-
tests/Resources/App/var/cache/test/RunOpenCode_Bundle_QueryResourcesLoader_Tests_Resources_App_TestKernelTestDebugContainer.xml
42-
</containerXml>
40+
<containerXml>tests/Resources/App/var/cache/test/RunOpenCode_Bundle_QueryResourcesLoader_Tests_Resources_App_TestKernelTestDebugContainer.xml</containerXml>
4341
</pluginClass>
4442
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
4543
</plugins>

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// when we are running only one test case.
1919
if (\in_array(\strtolower($bootstrap), ['yes', '1', 'true'], true)) {
2020
// Clear the cache before running the tests.
21-
(new Filesystem())->remove(__DIR__ . '/Resources/var/cache');
21+
(new Filesystem())->remove(__DIR__ . '/Resources/App/var/cache');
2222

2323
$kernel = new TestKernel('test', false);
2424

0 commit comments

Comments
 (0)