From cd5d8192bbb0a46bc56c6ab9e50877c6a1cd0ffc Mon Sep 17 00:00:00 2001 From: Jakob Givoni Date: Wed, 12 Feb 2025 15:46:24 +0100 Subject: [PATCH] adding to github actions --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36c569e..d43af51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,3 +68,36 @@ jobs: - name: Run unit tests run: docker exec mycontainer vendor/bin/phpunit + + job3: + strategy: + matrix: + php_version: ["8.1"] + name: PhpCsFixer code style checker ${{ matrix.php_version }} + runs-on: ubuntu-latest + steps: + - name: Checkout codebase + uses: actions/checkout@v3 + + - name: Enable caching + uses: satackey/action-docker-layer-caching@v0.0.11 + # Deprecation warnings are expected... + continue-on-error: true + + - name: Build image + run: docker image build . -f Dockerfile -t myimage:latest --build-arg PHP_VERSION=${{ matrix.php_version }} + + - name: Launch container + run: docker run -d -v "$(pwd)/:/app" --name mycontainer myimage:latest tail -f /dev/null + + - name: Check PHP version + run: docker exec mycontainer php -v + + - name: Check composer.json validity + run: docker exec mycontainer composer validate + + - name: Install dependencies + run: docker exec mycontainer composer install + + - name: Run unit tests + run: docker exec mycontainer vendor/friendsofphp/php-cs-fixer/php-cs-fixer check