-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (75 loc) · 2.21 KB
/
php-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: PHP Package
env:
PHAR_TOOL_VERSION: 1.4.0
PHAR_TOOL_REPOSITORY: clue/phar-composer
DEFAULT_PHP_VERSION: 8.3
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: ${{ env.DEFAULT_PHP_VERSION }}
tools: composer:v2
- 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 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
extensions: bz2
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
- name: Run Tests
run: composer test
- name: Prepare Release Artifact
env:
GH_TOKEN: ${{ github.token }}
run: |
composer install --no-dev
gh release download v${{ env.PHAR_TOOL_VERSION }} -R=${{ env.PHAR_TOOL_REPOSITORY }}
chmod +x ./phar-composer-${{ env.PHAR_TOOL_VERSION }}.phar
./phar-composer-${{ env.PHAR_TOOL_VERSION }}.phar build ./ mysql2jsonl
- name: Upload Release Artifact
uses: actions/upload-artifact@v4
with:
name: build-${{ github.sha }}-${{ matrix.php-version }}
path: mysql2jsonl