Build #1460
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: ['main', '2.5'] | |
pull_request: | |
release: | |
types: [created] | |
schedule: | |
- cron: '0 4 * * *' | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
name: Build and test | |
strategy: | |
matrix: | |
php: [8.1, 8.2, 8.3] | |
deps: [high] | |
include: | |
- php: 8.1 | |
deps: low | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ matrix.php }}" | |
ini-values: "phar.readonly=0" | |
- name: Test & package | |
if: matrix.deps == 'high' | |
run: make install test | |
- name: Coding standards | |
run: make package | |
- name: Test & package (min) | |
if: matrix.deps == 'low' | |
run: make update-min test-min | |
- name: Upload the phar | |
uses: actions/upload-artifact@v4 | |
if: matrix.php == '8.1' && matrix.deps == 'high' | |
with: | |
name: zalas-phpunit-globals-extension.phar | |
path: build/zalas-phpunit-globals-extension.phar | |
integration-tests: | |
runs-on: ubuntu-latest | |
name: Run integration tests | |
needs: tests | |
strategy: | |
matrix: | |
php: [8.1, 8.2, 8.3] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ matrix.php }}" | |
ini-values: "phar.readonly=0" | |
- name: Download the phar | |
uses: actions/download-artifact@v4 | |
with: | |
name: zalas-phpunit-globals-extension.phar | |
path: build/ | |
- name: Test the phar | |
run: | | |
make tests/phar/tools/phpunit tools/box && touch build/zalas-phpunit-globals-extension.phar && \ | |
make test-package | |
publish-phars: | |
runs-on: ubuntu-latest | |
name: Publish PHARs | |
needs: tests | |
if: github.event_name == 'release' | |
steps: | |
- name: Download the phar | |
uses: actions/download-artifact@v4 | |
with: | |
name: zalas-phpunit-globals-extension.phar | |
path: . | |
- name: Release the phar | |
uses: shogo82148/actions-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./zalas-phpunit-globals-extension.phar | |
asset_name: zalas-phpunit-globals-extension.phar | |
asset_content_type: application/zip |