Add pre-built lib feature, and more bugfix for 2.3 #5
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: Tests for PHP Pack Lib | |
on: | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- 'src/**' | |
- 'config/**' | |
- '.github/workflows/tests.yml' | |
- 'bin/**' | |
- 'composer.json' | |
- 'box.json' | |
- '.php-cs-fixer.php' | |
permissions: | |
contents: read | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
build: | |
name: "Pack Lib Test (${{ matrix.lib }} for ${{ matrix.os.name }}-${{ matrix.os.arch }})" | |
runs-on: ${{ matrix.os.runs-on }} | |
timeout-minutes: 120 | |
strategy: | |
matrix: | |
os: | |
- runs-on: ubuntu-latest | |
name: "linux" | |
arch: "x86_64" | |
- runs-on: macos-13 | |
name: "darwin" | |
arch: "x86_64" | |
- runs-on: windows-latest | |
name: "windows" | |
arch: "x86_64" | |
- runs-on: macos-14 | |
name: "darwin" | |
arch: "aarch64" | |
lib: | |
- pkg-config | |
- zlib | |
- bzip2 | |
- gmp | |
exclude: | |
- os: | |
runs-on: windows-latest | |
arch: "x86_64" | |
lib: pkg-config | |
lib: pkg-config | |
fail-fast: false | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Setup PHP" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
tools: pecl, composer | |
extensions: curl, openssl, mbstring | |
ini-values: memory_limit=-1 | |
- name: "Cache composer packages" | |
id: composer-cache | |
uses: actions/cache@v4 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-php- | |
# Cache downloaded source | |
- id: cache-download | |
uses: actions/cache@v4 | |
with: | |
path: downloads | |
key: pack-lib-dependencies | |
- name: "Install Dependencies" | |
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | |
- run: bin/spc doctor --auto-fix | |
- run: bin/spc download --for-libs="${{ matrix.lib }}" --debug --retry=5 --shallow-clone | |
- name: "Download pre-built pkg-config for *nix if possible" | |
if: matrix.os.name == 'linux' || matrix.os.name == 'darwin' | |
run: | | |
bin/spc download --for-libs="pkg-config" --debug --retry=5 --shallow-clone --prefer-pre-built | |
bin/spc build:libs pkg-config --debug | |
- if: matrix.os.name != 'windows' || matrix.lib != 'pkg-config' | |
run: bin/spc dev:pack-lib --debug ${{ matrix.lib }} | |
- name: "Upload packed lib (${{ matrix.lib }} for ${{ matrix.os.name }}-${{ matrix.os.arch }})" | |
uses: actions/upload-artifact@v2 | |
with: | |
path: dist/${{ matrix.lib }}-${{ matrix.os.arch }}-${{ matrix.os.name }}.txz | |
name: ${{ matrix.lib }}-${{ matrix.os.arch }}-${{ matrix.os.name }} |