-
Notifications
You must be signed in to change notification settings - Fork 13
185 lines (170 loc) · 5.7 KB
/
ci.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: CI
on:
push:
branches-ignore:
- 'main'
env:
BUILDER_VERSION: v0.8.18
BUILDER_SOURCE: releases
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-crt-php
LINUX_BASE_IMAGE: ubuntu-16-x64
RUN: ${{ github.run_id }}-${{ github.run_number }}
jobs:
php-5_5-linux-x64:
name: php-linux-x64 (5.5)
runs-on: ubuntu-latest
steps:
- name: Setup PHP with Xdebug
uses: shivammathur/setup-php@v2
with:
coverage: xdebug
php-version: 5.5
ini-values: xdebug.overload_var_dump=0, memory_limit=4G, phar.readonly=false
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build for PHP 5.5
env:
CC: clang
CXX: clang++
run: |
phpize
./configure
# Normally, CRT uses the system's default libcrypto.so.
# But in this CI run, PHP 5.5 is using a different older libcrypto.so, as PHP 5.5 cannot build with openssl >=1.1.1.
# When an applications uses two different libcrypto.so at the same time, things tend to explode.
# Therefore, in this CI run we build AWS-LC statically, and use its libcrypto.a instead.
USE_OPENSSL=OFF make
./dev-scripts/run_tests.sh
php-linux-x64:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
steps:
- name: Setup PHP with Xdebug
uses: shivammathur/setup-php@v2
with:
coverage: xdebug
php-version: ${{matrix.version}}
ini-values: xdebug.overload_var_dump=0, memory_limit=4G, phar.readonly=false
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Run tests
env:
CC: clang
CXX: clang++
run: |
phpize
./configure
make
./dev-scripts/run_tests.sh
# linux-arm:
# name: ARM (${{ matrix.arch }})
# runs-on: ubuntu-latest
# strategy:
# matrix:
# arch: [armv6, armv7, arm64]
# steps:
# - name: Build ${{ env.PACKAGE_NAME }}
# run: |
# python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
# chmod a+x builder
# ./builder build -p ${{ env.PACKAGE_NAME }} --target=linux-${{ matrix.arch }} --spec=downstream
windows-vc16:
runs-on: windows-2019
defaults:
run:
shell: cmd # use CMD instead of powershell to catch error from bat script
strategy:
matrix:
arch: [x64]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- id: setup-php-sdk
uses: cmb69/setup-php-sdk@v0.6
with:
version: '8.0'
arch: ${{ matrix.arch }}
ts: ts
deps: openssl
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
toolset: ${{steps.setup-php-sdk.outputs.toolset}}
# not sure why CMD can't do multiline run statements
- run: phpize
- run: .\configure --with-prefix=${{steps.setup-php-sdk.outputs.prefix}} --enable-awscrt=shared --enable-cli --enable-openssl
- run: nmake
- run: nmake generate-php-ini
- run: .\dev-scripts\run_tests.bat ${{steps.setup-php-sdk.outputs.prefix}}\php
# windows-vc14:
# runs-on: windows-latest
# strategy:
# matrix:
# arch: [x86, x64]
# steps:
# - uses: ilammy/msvc-dev-cmd@v1
# with:
# toolset: 14.0
# arch: ${{ matrix.arch }}
# uwp: false
# spectre: true
# - name: Build ${{ env.PACKAGE_NAME }} + consumers
# run: |
# python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
# python builder.pyz build -p ${{ env.PACKAGE_NAME }} downstream
macos:
runs-on: macos-${{ matrix.version }}
strategy:
matrix:
version: [10.15]
steps:
# Force PHP to 8.0
# Doing this because tests fail in PHP 8.1 (default on macos Github Runner as of Dec 2021)
# due to the old version of PHPUnit we're using.
# We're using an old PHPUnit because it's compatible our min supported PHP 5.5.
# Quick fix is to force PHP version back to 8.0, which can still run our tests without error.
# A real solution is to get our tests working on all PHP versions
# (maybe don't use PHPUnit, maybe raise our min supported PHP version so we can upgrade,
# or maybe use PHPUnit-Polyfills so we can use a modern PHPUnit with old PHP)
- name: Setup PHP 8.0
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
- name: Build PHP 8 extension and test
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream
pecl-package-test:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Test PECL package build
run: |
python3 dev-scripts/prepare_pecl_release.py --name aws-crt --user aws-crt --version 1.0.0
sudo pecl install awscrt-1.0.0.tgz