1010 - ' .config/phpcs.xml.dist'
1111 - ' .config/phpunit.xml.dist'
1212 - ' .github/workflows/php.yml'
13- - ' composer.json'
14- - ' composer.lock'
13+ - ' solid/ composer.json'
14+ - ' solid/ composer.lock'
1515 branches : [ main ]
1616 types : [ opened, reopened, synchronize ]
1717 # This event occurs when there is a push to the repository.
2121 - ' .config/phpcs.xml.dist'
2222 - ' .config/phpunit.xml.dist'
2323 - ' .github/workflows/php.yml'
24- - ' composer.json'
25- - ' composer.lock'
24+ - ' solid/ composer.json'
25+ - ' solid/ composer.lock'
2626 # Allow manually triggering the workflow.
2727 workflow_dispatch :
2828
@@ -57,14 +57,27 @@ jobs:
5757 steps :
5858 - uses : actions/checkout@v4
5959 - run : >-
60- composer validate
61- --check-lock
62- --no-plugins
63- --no-scripts
64- --strict
60+ composer validate
61+ --check-lock
62+ --no-plugins
63+ --no-scripts
64+ --strict
6565 working-directory: "solid"
6666 # 02.test.php.test-unit.yml
6767 php-unittest :
68+ container :
69+ image : ghcr.io/${{ github.repository }}:main-${{ matrix.nextcloud_version }}
70+ env :
71+ COMPOSER_AUTH : ' {"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
72+ NEXTCLOUD_PATH : /usr/src/nextcloud/apps
73+ NEXTCLOUD_UPDATE : 1
74+ XDEBUG_MODE : coverage
75+ volumes :
76+ - /usr/bin/composer:/usr/bin/composer
77+ defaults :
78+ run :
79+ shell : bash
80+ working-directory : /usr/src/nextcloud/apps/solid/
6881 name : PHP Unit Tests
6982 needs :
7083 - lint-php-syntax
@@ -78,27 +91,24 @@ jobs:
7891 - 29
7992 - 30
8093 steps :
81- - uses : actions/checkout@v4
82- - uses : shivammathur/setup-php@v2
83- with :
84- ini-values : error_reporting=E_ALL, display_errors=On
85- php-version : 8.3
94+ - uses : actions/checkout@v5
95+ # @CHECKME: cp site.conf /etc/apache2/sites-enabled/000-default.conf (?)
96+ - name : Setup Test Environment
97+ run : |
98+ git config --global --add safe.directory "${NEXTCLOUD_PATH}"
99+ /entrypoint.sh "echo"
100+ bash "${GITHUB_WORKSPACE}/init.sh"
101+ rm -r "${NEXTCLOUD_PATH}/solid/"
102+ cp --archive --verbose "${GITHUB_WORKSPACE}/." "${NEXTCLOUD_PATH}"
103+ working-directory : /usr/src/nextcloud/
86104 - name : Install and Cache Composer dependencies
87- uses : " ramsey/composer-install@v2 "
105+ uses : ramsey/composer-install@v3
88106 with :
89- working-directory : " solid"
107+ working-directory : /usr/src/nextcloud/apps/ solid
90108 env :
91109 COMPOSER_AUTH : ' {"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
92- - run : |
93- docker run \
94- --env 'XDEBUG_MODE=coverage' \
95- --rm \
96- --volume="./solid:/var/www/html/apps/solid" \
97- ghcr.io/${{ github.repository }}:main-${{ matrix.nextcloud_version }} \
98- bash -c 'NEXTCLOUD_UPDATE=1 /entrypoint.sh "echo" \
99- && sudo -u www-data bash /init.sh \
100- && cd /var/www/html/apps/solid \
101- && bin/phpunit --configuration phpunit.xml'
110+ - name : Run PHPUnit
111+ run : bin/phpunit --configuration phpunit.xml
102112
103113 # 03.quality.php.scan.dependencies-vulnerabilities.yml
104114 scan-dependencies-vulnerabilities :
@@ -109,12 +119,12 @@ jobs:
109119 steps :
110120 - uses : actions/checkout@v4
111121 - run : >-
112- composer audit
113- --abandoned=report
114- --locked
115- --no-dev
116- --no-plugins
117- --no-scripts
122+ composer audit
123+ --abandoned=report
124+ --locked
125+ --no-dev
126+ --no-plugins
127+ --no-scripts
118128 working-directory: "solid"
119129 # 03.quality.php.lint-quality.yml
120130 php-lint-quality :
0 commit comments