Skip to content

chore(tests): add composer cache for build process #43

chore(tests): add composer cache for build process

chore(tests): add composer cache for build process #43

Workflow file for this run

name: PHP Package
env:
PHAR_TOOL_VERSION: 1.4.0
PHAR_TOOL_REPOSITORY: clue/phar-composer
on:
push:
pull_request:
workflow_call:
jobs:
format-check:
name: Check PSR12 Standarts
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: composer:v2
- run: composer install
shell: bash
- run: composer format:check
shell: bash
tests:
name: Run Tests
runs-on: ubuntu-24.04
strategy:
matrix:
php-version:
- 8.2
- 8.3
- 8.4
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
coverage: xdebug3
- name: Composer Cache
id: composer-cache
run: |
echo "cache_directory=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.cache_directory }}
key: ${{ runner.os }}-composer
- run: composer install
shell: bash
- run: composer test
shell: bash
- name: Download build package
run: gh release download v${{ env.PHAR_TOOL_VERSION }} -R=${{ env.PHAR_TOOL_REPOSITORY }}
env:
GH_TOKEN: ${{ github.token }}
- name: Build package
run: |
chmod +x ./phar-composer-${{ env.PHAR_TOOL_VERSION }}.phar
./phar-composer-${{ env.PHAR_TOOL_VERSION }}.phar build ./ mysql2jsonl
- uses: actions/upload-artifact@v4
with:
name: build-${{ github.sha }}-${{ matrix.php-version }}
path: mysql2jsonl