Skip to content

Merge pull request #70 from sjinks/renovate/shivammathur-setup-php-2.x #147

Merge pull request #70 from sjinks/renovate/shivammathur-setup-php-2.x

Merge pull request #70 from sjinks/renovate/shivammathur-setup-php-2.x #147

Workflow file for this run

name: Build and Test
on:
push:
workflow_dispatch:
env:
CFLAGS: "-O2 -Wall -Werror"
jobs:
ci:
permissions:
contents: read
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') || github.event_name == 'workflow_dispatch' }}
strategy:
fail-fast: false
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
- 'nightly'
features:
- "--with-cap --without-capng"
- "--without-cap --with-capng"
name: "Build and Test (PHP ${{ matrix.php }}, ${{ matrix.features }})"
runs-on: ubuntu-latest
steps:
- name: Check out the source code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up PHP
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # 2.31.1
with:
php-version: ${{ matrix.php }}
tools: none
- name: Install build dependencies
run: sudo apt-get -qq update && sudo apt-get -qq install libcap-dev libcap-ng-dev
- name: Add error matcher
run: echo "::add-matcher::$(pwd)/.github/problem-matcher-gcc.json"
- name: Build
run: phpize && ./configure ${{ matrix.features }} --silent && make --silent
working-directory: chuid
- name: Copy posix extension
run: |
if [ -f "$(php-config --extension-dir)/posix.so" ]; then
cp $(php-config --extension-dir)/posix.so chuid/modules
fi
- name: Update PHP test runner if necessary
run: |
if ! php -r 'exit((int)(PHP_VERSION_ID < 80200));'; then
cp -f helpers/run-tests.php chuid/run-tests.php
fi
- name: Set DOCUMENT_ROOT for CGI tests
run: echo "DOCUMENT_ROOT=$(pwd)/chuid" >> "${GITHUB_ENV}"
- name: Run tests
run: sudo -E make test
env:
NO_INTERACTION: "1"
REPORT_EXIT_STATUS: "1"
working-directory: chuid