Skip to content

Commit

Permalink
ci: add job to compile PHAR in integration mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed May 24, 2024
1 parent 0dfb22c commit 55a12e5
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,71 @@ jobs:

- name: 🧪 Run tests that require separate process using phpunit/phpunit
run: composer test:sep

compile-phar:
timeout-minutes: 4
runs-on: ${{ matrix.os }}
concurrency:
cancel-in-progress: true
group: testing-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}-${{ matrix.dependencies }}
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
php-version:
- '8.2'
dependencies:
- locked
env:
TRAP_PHAR: ".build/phar/trap.phar"
TRAP_PHAR_SIGNATURE: ".build/phar/trap.phar.asc"
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v4.1.5

- name: 🛠️ Setup PHP
uses: shivammathur/setup-php@2.30.4
with:
php-version: ${{ matrix.php-version }}
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, sockets
ini-values: 'error_reporting=E_ALL, memory_limit=-1, phar.readonly=0'
coverage: none
tools: phive

- name: 🛠️ Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: 🔍 Get composer cache directory
uses: wayofdev/gh-actions/actions/composer/get-cache-directory@v3.1.0

- name: ♻️ Restore cached dependencies installed with composer
uses: actions/cache@v4.0.2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-

- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer
uses: wayofdev/gh-actions/actions/composer/install@v3.1.0
with:
dependencies: ${{ matrix.dependencies }}

- name: 📥 Install dependencies with phive
uses: wayofdev/gh-actions/actions/phive/install@v3.1.0
with:
phive-home: '.phive'
trust-gpg-keys: '0xC00543248C87FB13,0x033E5F8D801A2F8D,0x2DF45277AEF09A2F'

- name: 🔍 Validate configuration for box-project/box
run: .phive/box validate box.json.dist --ansi

- name: 🤖 Compile trap.phar with box-project/box
run: .phive/box compile --ansi

- name: 💥 Show info about trap.phar with box-project/box
run: .phive/box info ${{ env.TRAP_PHAR }} --ansi

- name: 🤔 Run trap.phar help command
run: ${{ env.TRAP_PHAR }} --help

0 comments on commit 55a12e5

Please sign in to comment.