-
Notifications
You must be signed in to change notification settings - Fork 32
131 lines (123 loc) · 3.35 KB
/
main.yml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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"
- "8.4"
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/