Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 2 additions & 44 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,8 @@ jobs:
# Don't run on forks.
if: github.repository == 'php-parallel-lint/PHP-Parallel-Lint'

name: Bundle binary
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: exif, phar, openssl, sodium
coverage: none
ini-values: phar.readonly=Off, error_reporting=-1, display_errors=On, zend.assertions=1
# Autoload files generated with Composer 2.3 are not compatible with PHP < 7.0.
tools: composer:2.2
env:
fail-fast: true

- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
composer-options: "--no-dev"
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

# Note: do NOT turn on the requirement checker in the box config as it is no longer
# compatible with PHP < 7.2.
- name: Install Box
run: wget https://github.com/box-project/box/releases/latest/download/box.phar -O box.phar && chmod 0755 box.phar && pwd

- name: Validate configuration
run: php box.phar validate -i box.json

- name: Building binary...
run: php box.phar compile -v --config=box.json

- name: Show info about the build phar with box-project/box
run: php box.phar info -l parallel-lint.phar

- uses: actions/upload-artifact@v4
with:
name: parallel-lint-phar
path: ./parallel-lint.phar
name: Build binary
uses: ./.github/workflows/reusable-build-binary.yml

verify:
name: Validate binary on PHP ${{ matrix.php }}
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/reusable-build-binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Binary

on:
workflow_call:

jobs:
bundle:
name: Build binary
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: exif, phar, openssl, sodium
coverage: none
ini-values: phar.readonly=Off, error_reporting=-1, display_errors=On, zend.assertions=1
# Autoload files generated with Composer 2.3 are not compatible with PHP < 7.0.
tools: composer:2.2
env:
fail-fast: true

- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
composer-options: "--no-dev"
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

# Note: do NOT turn on the requirement checker in the box config as it is no longer
# compatible with PHP < 7.2.
- name: Install Box
run: wget https://github.com/box-project/box/releases/latest/download/box.phar -O box.phar && chmod 0755 box.phar && pwd

- name: Validate configuration
run: php box.phar validate -i box.json

- name: Building binary...
run: php box.phar compile -v --config=box.json

- name: Show info about the build phar with box-project/box
run: php box.phar info -l parallel-lint.phar

- name: Upload PHAR to workflow summary
uses: actions/upload-artifact@v4
with:
name: parallel-lint-phar
path: ./parallel-lint.phar
46 changes: 2 additions & 44 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,50 +45,8 @@ jobs:
run: cs2pr ./phpcs-report.xml

bundle:
name: Bundle binary
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: exif, phar, openssl, sodium
coverage: none
ini-values: phar.readonly=Off, error_reporting=-1, display_errors=On, zend.assertions=1
# Autoload files generated with Composer 2.3 are not compatible with PHP < 7.0.
tools: composer:2.2
env:
fail-fast: true

- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
composer-options: "--no-dev"
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

# Note: do NOT turn on the requirement checker in the box config as it is no longer
# compatible with PHP < 7.2.
- name: Install Box
run: wget https://github.com/box-project/box/releases/latest/download/box.phar -O box.phar && chmod 0755 box.phar && pwd

- name: Validate configuration
run: php box.phar validate -i box.json

- name: Building binary...
run: php box.phar compile -v --config=box.json

- name: Show info about the build phar with box-project/box
run: php box.phar info -l parallel-lint.phar

- uses: actions/upload-artifact@v4
with:
name: parallel-lint-phar
path: ./parallel-lint.phar
name: Build binary
uses: ./.github/workflows/reusable-build-binary.yml

test:
name: Run tests on PHP ${{ matrix.php }}
Expand Down