Repository navigation
55 lines (52 loc) · 1.8 KB
/
Copy pathci.yml
File metadata and controls
55 lines (52 loc) · 1.8 KB
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
name: CI
on:
pull_request:
branches: [ "main", "master" ]
jobs:
build-test:
runs-on: ubuntu-24.04
strategy:
matrix:
php: [ '8.3', '8.4', '8.5' ]
name: PHP ${{ matrix.php }} build & test
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: none
coverage: none
- name: Build extension
run: |
phpize
./configure --enable-blake3
make -j$(nproc)
sudo make install
- name: php -v
run: php -v
- name: Official PHPT tests
env:
TEST_PHP_ARGS: -d extension=blake3
NO_INTERACTION: 1
run: |
export TEST_PHP_EXECUTABLE="$(command -v php)"
RUN_TESTS="$(find /usr/lib/php -name run-tests.php | head -n1)"
echo "Using runner: ${RUN_TESTS}"
if [ -z "${RUN_TESTS}" ]; then
echo "run-tests.php not found under /usr/lib/php" >&2
exit 1
fi
# run-tests.php writes run-test-info.php next to itself, but the system
# build dir is not writable by the runner user. Copy it to a writable
# temp dir so it can generate its helper files.
cp "${RUN_TESTS}" "${RUNNER_TEMP:-/tmp}/run-tests.php"
php "${RUNNER_TEMP:-/tmp}/run-tests.php" -q --show-diff --show-slow 1000 --set-timeout 120 tests
- name: Custom runner smoke check
env:
CUSTOM_PHPT_RUNNER: 1
# Make phpt_runner.php load the extension in the child PHP process,
# otherwise every test is reported as SKIPPED.
PHPT_ADD_EXTENSION: 1
run: |
for f in tests/*.phpt; do php -d extension=blake3 .github/phpt_runner.php "$f" || exit 1; done