Changed version to 1.4.0 #4
Workflow file for this run
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 and test phar | |
on: | |
push: | |
tags: | |
- 'v*' | |
# Allow manually triggering the workflow. | |
workflow_dispatch: | |
# Cancels all previous workflow runs for the same branch that have not yet completed. | |
concurrency: | |
# The concurrency group contains the workflow name and the branch name. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
bundle: | |
# 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@v4 | |
- 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 | |
verify: | |
name: Validate binary on PHP ${{ matrix.php }} | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.php == '8.3' }} | |
needs: | |
- bundle | |
strategy: | |
matrix: | |
php: | |
- '5.3' | |
- '5.4' | |
- '5.5' | |
- '5.6' | |
- '7.0' | |
- '7.1' | |
- '7.2' | |
- '7.3' | |
- '7.4' | |
- '8.0' | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: parallel-lint-phar | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
ini-values: error_reporting=-1, display_errors=On, zend.assertions=1 | |
coverage: none | |
- name: Run linter against codebase | |
run: php ./parallel-lint.phar src/ | |
publish: | |
name: Add binary to release | |
runs-on: ubuntu-latest | |
needs: | |
- bundle | |
- verify | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: parallel-lint-phar | |
- name: Draft Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: true | |
prerelease: false | |
make_latest: true | |
files: parallel-lint.phar | |
fail_on_unmatched_files: true |