Skip to content

Commit

Permalink
Update Github Actions workflows (#98)
Browse files Browse the repository at this point in the history
* feat: format yaml files and add new matrix test entries

* feat: specify xdebug version in matrix entries

* fix: remove new matrix entries

* fix: keep single quotes

* tests(dump-pprof): wider match in expectf

* fix: try to use newer macos version
  • Loading branch information
gaelreyrol authored Nov 29, 2023
1 parent 243788c commit b02c754
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 70 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: 'Package'

on:
pull_request:
pull_request:

jobs:
package:
name: 'Package'
runs-on: 'ubuntu-20.04'
steps:
- name: 'Check out repository'
uses: 'actions/checkout@v2'
with:
path: 'ext'
package:
name: 'Package'
runs-on: 'ubuntu-22.04'
steps:
- name: 'Check out repository'
uses: 'actions/checkout@v4'
with:
path: 'ext'

- name: 'Install dependencies'
run: 'sudo apt-get -y install php7.4-dev libjudy-dev'
- name: 'Install dependencies'
run: 'sudo apt-get -y install php8.1-dev libjudy-dev'

- name: 'Package and verify package'
run: './ext/.github/workflows/package/package.sh'
- name: 'Package and verify package'
run: './ext/.github/workflows/package/package.sh'

- name: 'Archive package'
uses: 'actions/upload-artifact@v2'
with:
path: 'ext/memprof.tgz'
- name: 'Archive package'
uses: 'actions/upload-artifact@v3'
with:
path: 'ext/memprof.tgz'
108 changes: 57 additions & 51 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,72 @@
name: 'Tests'

on:
push:
branches:
- v3
pull_request:
schedule:
- cron: '30 8 * * 1'
push:
branches:
- v3
pull_request:
schedule:
- cron: '30 8 * * 1'

jobs:
tests:
name: 'Tests'
strategy:
matrix:
include:
- php: '8.1.0'
os: 'ubuntu-20.04'
expect_native: 1
werror: 1
tests:
name: 'Tests'
strategy:
matrix:
include:
- php: '8.1.0'
os: 'ubuntu-20.04'
expect_native: 1
werror: 1
xdebug: '3.1.2'

- php: '8.0.0'
os: 'ubuntu-20.04'
expect_native: 1
- php: '8.1.0'
os: 'macos-13'
xdebug: '3.1.2'

- php: '8.1.0'
os: 'macos-10.15'
- php: '8.0.0'
os: 'ubuntu-20.04'
expect_native: 1
xdebug: '3.1.2'

- php: '7.4.0'
os: 'ubuntu-20.04'
expect_native: 1
- php: '7.4.0'
os: 'ubuntu-20.04'
expect_native: 1
xdebug: '3.1.2'

- php: '7.3.0'
os: 'ubuntu-20.04'
expect_native: 1
- php: '7.3.0'
os: 'ubuntu-20.04'
expect_native: 1
xdebug: '3.1.2'

runs-on: ${{ matrix.os }}
continue-on-error: ${{ !!matrix.experimental }}
env:
PHP_VERSION: ${{ matrix.php }}
PHP_TAG: ${{ matrix.tag }}
MEMORY_CHECK: ${{ matrix.memcheck }}
WERROR: ${{ matrix.werror }}
MEMPROF_EXPECT_NATIVE_TRACKING: ${{ matrix.expect_native }}
steps:
- name: 'Check out repository'
uses: 'actions/checkout@v2'
with:
path: 'ext'
runs-on: ${{ matrix.os }}
continue-on-error: ${{ !!matrix.experimental }}
env:
PHP_VERSION: ${{ matrix.php }}
PHP_TAG: ${{ matrix.tag }}
MEMORY_CHECK: ${{ matrix.memcheck }}
WERROR: ${{ matrix.werror }}
MEMPROF_EXPECT_NATIVE_TRACKING: ${{ matrix.expect_native }}
XDEBUG_VERSION: ${{ matrix.xdebug }}
steps:
- name: 'Check out repository'
uses: 'actions/checkout@v4'
with:
path: 'ext'

- uses: actions/cache@v2
with:
path: ~/build-cache/php
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.memcheck }}
- uses: 'actions/cache@v3'
with:
path: '~/build-cache/php'
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.memcheck }}

- name: 'Build PHP'
run: './ext/.github/workflows/test/build-php.sh'
- name: 'Build PHP'
run: './ext/.github/workflows/test/build-php.sh'

- name: 'Install xdebug'
run: './ext/.github/workflows/test/build-xdebug.sh'
- name: 'Install xdebug'
run: './ext/.github/workflows/test/build-xdebug.sh'

- name: 'Build extension'
run: './ext/.github/workflows/test/build-extension.sh'
- name: 'Build extension'
run: './ext/.github/workflows/test/build-extension.sh'

- name: 'Run tests'
run: './ext/.github/workflows/test/tests.sh'
- name: 'Run tests'
run: './ext/.github/workflows/test/tests.sh'
2 changes: 1 addition & 1 deletion .github/workflows/test/build-xdebug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
export PATH="$HOME/php/bin:$PATH"
hash -r

git clone --depth 1 --branch "3.1.2" "https://github.com/xdebug/xdebug.git"
git clone --depth 1 --branch "${XDEBUG_VERSION}" "https://github.com/xdebug/xdebug.git"

cd xdebug

Expand Down
2 changes: 1 addition & 1 deletion tests/dump-pprof.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ binary=php://stdout
0x0000000000000038 memprof_dump_pprof
---
--- profile
%s
%a

0 comments on commit b02c754

Please sign in to comment.