Skip to content

Commit 3653144

Browse files
authored
Change PHP CI workflow to use docker container for entir PHPUnit run
1 parent 4fc7618 commit 3653144

1 file changed

Lines changed: 19 additions & 15 deletions

File tree

.github/workflows/php.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,19 @@ jobs:
7070
- lint-php-syntax
7171
- validate-dependencies-file
7272
runs-on: ubuntu-24.04
73+
container:
74+
image: ghcr.io/${{ github.repository }}:main-${{ matrix.nextcloud_version }}
75+
env:
76+
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
77+
XDEBUG_MODE: coverage
78+
volumes:
79+
# Apache config
80+
- ./site.conf:/etc/apache2/sites-enabled/000-default.conf
81+
# Init script
82+
- ./init.sh:/init.sh
83+
# Library code
84+
- ./solid/:/var/www/html/apps/solid/
85+
- ./.config/:/var/www/html/apps/.config
7386
strategy:
7487
fail-fast: false
7588
matrix:
@@ -79,26 +92,17 @@ jobs:
7992
- 30
8093
steps:
8194
- 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
8695
- name: Install and Cache Composer dependencies
87-
uses: "ramsey/composer-install@v2"
96+
uses: ramsey/composer-install@v2
8897
with:
8998
working-directory: "solid"
9099
env:
91100
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'
101+
- name: Run PHPUnit
102+
run: |
103+
/var/www/html/apps/solid/bin/phpunit \
104+
--configuration /var/www/html/apps/solid/phpunit.xml \
105+
/var/www/html/apps/solid/tests/Unit
102106
103107
# 03.quality.php.scan.dependencies-vulnerabilities.yml
104108
scan-dependencies-vulnerabilities:

0 commit comments

Comments
 (0)