Files
FOSSBilling/.github/workflows/php.yml
T
Belle Aerni 3011c8a4b0 Move PHPStan to it's own action & bump the scanning level (#629)
* Move PHPStan to it's own action

* Bump PHPStan to level 1

* This fix it?

* Update Box_MailTest.php

* And fix a typo in the action

* Update phpstan.yml

* Update phpstan.yml

* Test
2022-12-28 04:32:17 -08:00

76 lines
2.1 KiB
YAML

name: PHP Composer
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ["8.0", "8.1", "8.2"]
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Check PHP Version
run: php -v
- name: Clone and update the locale submodule.
run: git submodule update --init --recursive
working-directory: ./src/locale
- name: Validate composer.json and composer.lock
run: composer validate
working-directory: ./src
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: ./src/vendor
key: ${{ runner.os }}-php-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest
working-directory: ./src
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
- name: Run test suite for composer updates.
run: composer install --prefer-dist --no-progress --no-suggest
working-directory: ./src
- name: Configure environment for Tests
run: |
cp ./src/config-sample.php ./src/config.php
mkdir -p ./src/data/cache
mkdir -p ./src/data/log
echo > ./src/data/log/license.log
echo > ./src/data/log/application.log
echo > ./src/data/log/php_error.log
rm -rf ./src/install
- name: Run test suite for modules
run: |
php ./src/vendor/bin/phpunit ./tests/modules/
- name: Run test suite for library
run: |
php ./src/vendor/bin/phpunit ./tests/library/