mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-30 20:27:07 +09:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [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/v3...v4) --- 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>
105 lines
2.6 KiB
YAML
105 lines
2.6 KiB
YAML
name: Build and Test
|
|
|
|
on:
|
|
push:
|
|
branches: main
|
|
pull_request:
|
|
branches: main
|
|
|
|
jobs:
|
|
composer:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php: [ 8.0, 8.1, 8.2 ]
|
|
|
|
name: PHP ${{ matrix.php }} - Build and Archive
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Validate composer.json and composer.lock
|
|
uses: php-actions/composer@v6
|
|
with:
|
|
command: validate
|
|
|
|
- name: Cache Composer Dependencies
|
|
id: composer-cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ./src/vendor
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-composer-
|
|
|
|
- name: Install Composer Dependencies
|
|
if: steps.composer-cache.outputs.cache-hit != 'true'
|
|
uses: php-actions/composer@v6
|
|
with:
|
|
php_version: ${{ matrix.php }}
|
|
|
|
- name: Create Build Archive 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
|
|
mkdir /tmp/builds/ && tar -cvf /tmp/builds/build.tar ./
|
|
|
|
- name: Upload Build Archive for Tests
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: build-archive-php${{ matrix.php }}
|
|
path: /tmp/builds
|
|
retention-days: 1
|
|
|
|
phpstan:
|
|
runs-on: ubuntu-latest
|
|
needs: [ composer ]
|
|
strategy:
|
|
matrix:
|
|
php: [ 8.0 ]
|
|
|
|
name: PHPStan
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: build-archive-php${{ matrix.php }}
|
|
path: /tmp/builds
|
|
|
|
- name: Extract build archive
|
|
run: tar -xvf /tmp/builds/build.tar ./
|
|
|
|
- name: Run PHPStan
|
|
uses: php-actions/phpstan@v3
|
|
with:
|
|
php_version: ${{ matrix.php }}
|
|
configuration: phpstan.neon
|
|
memory_limit: 512M
|
|
version: latest
|
|
|
|
phpunit:
|
|
runs-on: ubuntu-latest
|
|
needs: [ composer, phpstan ]
|
|
strategy:
|
|
matrix:
|
|
php: [ 8.0, 8.1, 8.2 ]
|
|
|
|
name: PHP ${{ matrix.php }} - PHPUnit
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: build-archive-php${{ matrix.php }}
|
|
path: /tmp/builds
|
|
|
|
- name: Extract Build Archive
|
|
run: tar -xvf /tmp/builds/build.tar ./
|
|
|
|
- name: Run PHPUnit Tests
|
|
uses: php-actions/phpunit@v3
|
|
with:
|
|
version: 9
|
|
php_version: ${{ matrix.php }}
|
|
configuration: phpunit.xml.dist |