Skip to content

Commit 3fbb474

Browse files
author
Alcides Ramos
committed
ci(ci.yml): force the CI to use custom Docker images
1 parent 58c18e6 commit 3fbb474

File tree

1 file changed

+18
-36
lines changed

1 file changed

+18
-36
lines changed

.github/workflows/ci.yml

+18-36
Original file line numberDiff line numberDiff line change
@@ -10,52 +10,34 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
tests:
14-
runs-on: ${{ matrix.os }}
13+
testsuite:
14+
name: Testsuite
15+
16+
runs-on: ubuntu-latest
1517

1618
env:
1719
ENV: DEVELOPMENT
1820

19-
strategy:
20-
fail-fast: true
21-
matrix:
22-
os: [ubuntu-latest]
23-
php: ['8.3']
24-
dependency_version: [prefer-dist, prefer-source]
25-
26-
name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency_version }}
27-
2821
steps:
29-
- name: Checkout
30-
uses: actions/checkout@v4
22+
- uses: actions/checkout@v4
3123

32-
- name: Setup PHP & Enable Extensions
33-
uses: shivammathur/setup-php@v2
34-
with:
35-
php-version: ${{ runner.php }}
36-
extensions: uopz
37-
coverage: pcov
24+
- name: Build the Docker image
25+
run: docker build --file Dockerfile --target build-development --tag dockerized-php:dev .
3826

3927
- name: Validate composer.json and composer.lock
40-
run: composer validate --working-dir=./src --strict
41-
42-
- name: Cache Composer packages
43-
id: composer-cache
44-
uses: actions/cache@v4
45-
with:
46-
path: ./src/vendor
47-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
48-
restore-keys: |
49-
${{ runner.os }}-php-
28+
run: docker run --rm --interactive --mount type=bind,source="$(pwd)"/src,target=/var/www/html dockerized-php:dev composer validate --ansi --working-dir=. --strict
5029

5130
- name: Install PHP dependencies
52-
run: composer install --working-dir=./src --${{ matrix.dependency_version }} --no-interaction --no-progress --ansi
31+
run: docker run --rm --interactive --mount type=bind,source="$(pwd)"/src,target=/var/www/html dockerized-php:dev composer install --ansi --working-dir=. --no-interaction --no-progress
32+
33+
- name: Check Syntax
34+
run: docker run --rm --interactive --mount type=bind,source="$(pwd)"/src,target=/var/www/html dockerized-php:dev composer check-syntax --ansi
5335

54-
- name: Check Coding Standards
55-
run: ./src/vendor/bin/phpcs --standard=./src/phpcs.xml ./src/app ./src/tests
36+
- name: Check Style
37+
run: docker run --rm --interactive --mount type=bind,source="$(pwd)"/src,target=/var/www/html dockerized-php:dev composer check-style --ansi
5638

57-
- name: Check with PHPStan
58-
run: ./src/vendor/bin/phpstan analyse --configuration=./src/phpstan.neon ./src/app ./src/tests
39+
- name: Check PHPStan
40+
run: docker run --rm --interactive --mount type=bind,source="$(pwd)"/src,target=/var/www/html dockerized-php:dev composer phpstan --ansi
5941

60-
- name: Check Test Cases
61-
run: ./src/vendor/bin/phpunit --configuration=./src/phpunit.xml
42+
- name: Check PHPUnit
43+
run: docker run --rm --interactive --mount type=bind,source="$(pwd)"/src,target=/var/www/html dockerized-php:dev composer tests --ansi

0 commit comments

Comments
 (0)