Skip to content

CI: Add build for php8.3 & enable artifact collection (#82) #51

CI: Add build for php8.3 & enable artifact collection (#82)

CI: Add build for php8.3 & enable artifact collection (#82) #51

Workflow file for this run

name: CI
on:
push:
branches:
- php7
pull_request:
branches:
- php7
workflow_dispatch:
jobs:
ubuntu:
name: Ubuntu
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libyaml-dev
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "none"
tools: "phpize, php-config"
- name: Generate build files
run: phpize
- name: Configure build
run: CFLAGS="-Werror -Wall -fno-strict-aliasing" ./configure --with-yaml
- name: Report gcc problems
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: make all
- name: Run tests
run: >-
REPORT_EXIT_STATUS=1
NO_INTERACTION=1
TEST_PHP_EXECUTABLE=$(which php)
php -n
-d open_basedir=
-d output_buffering=0
-d memory_limit=-1
run-tests.php -n
-d extension_dir=modules
-d extension=yaml.so
--show-diff
tests
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: "yaml_${{ matrix.php-version }}_linux"
path: .libs/yaml.so
windows:
name: Windows
runs-on: windows-2019
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
arch:
- "x64"
ts:
- nts
- ts
vsversion:
- "16.0"
libyaml:
- libyaml-0.1.7-vs16
steps:
- name: Configure git
run: git config --system core.autocrlf false
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup PHP
id: setup-php
uses: php/[email protected]
with:
version: "${{ matrix.php-version }}"
arch: "${{ matrix.arch }}"
ts: "${{ matrix.ts }}"
- name: Download deps
run: |
curl -LO https://windows.php.net/downloads/pecl/deps/${{ matrix.libyaml }}-${{ matrix.arch }}.zip
7z x ${{ matrix.libyaml }}-${{ matrix.arch }}.zip -o..\deps
dir ..\deps
- name: Enable developer cli
uses: ilammy/msvc-dev-cmd@v1
with:
arch: "${{ matrix.arch }}"
toolset: "${{ steps.setup-php.outputs.toolset }}"
vsversion: "${{ matrix.vsversion }}"
- name: Generate build files
run: phpize
- name: Configure build
run: configure --with-yaml --with-php-build=..\deps --with-prefix=${{ steps.setup-php.outputs.prefix }}
- name: Report msvc problems
uses: ammaraskar/msvc-problem-matcher@master
- name: Build
run: nmake /D /P
- name: Run tests
run: nmake test TESTS="-n --show-diff tests"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: "yaml_${{ matrix.php-version }}_win32_${{ matrix.ts }}_${{ matrix.arch }}"
path: x64/