Files
FOSSBilling/.github/workflows/php.yml
T
31102836b3 Bump actions/checkout from 2 to 3 (#101)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
Co-authored-by: Benjamin Aerni <aernibenjamin@gmail.com>
2022-05-29 20:12:09 -07:00

68 lines
2.0 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"]
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: 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/bb-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/bb-config-sample.php ./src/bb-config.php
mkdir -p ./src/bb-data/cache
mkdir -p ./src/bb-data/log
echo > ./src/bb-data/log/license.log
echo > ./src/bb-data/log/application.log
echo > ./src/bb-data/log/php_error.log
rm -rf ./src/install
- name: Run test suite for bb-modules
run: |
php ./src/bb-vendor/bin/phpunit ./tests/bb-modules/
- name: Run test suite for bb-library
run: |
php ./src/bb-vendor/bin/phpunit ./tests/bb-library/