forked from hnw/php-timecop
-
Notifications
You must be signed in to change notification settings - Fork 5
94 lines (92 loc) · 2.31 KB
/
build.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
name: Build Timecop
on:
push:
branches:
- master
pull_request:
release:
types: [created]
jobs:
build:
name: PHP ${{ matrix.php-version }} (ZTS ${{ matrix.php-zts }})
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
php-version:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
php-zts:
- nts
- ts
exclude:
- php-version: '5.6'
php-zts: 'ts'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
env:
phpts: ${{ matrix.php-zts }}
- name: PHP version
run: |
php --version
- name: Set PHP_API
run: |
echo "PHP_API=$(php-config --phpapi)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |
phpize
./configure
make
make test REPORT_EXIT_STATUS=1 NO_INTERACTION=1 TESTS="--show-all"
- name: Save artifact (NTS)
uses: actions/upload-artifact@v4
if: matrix.php-zts == 'nts'
with:
name: timecop_${{ env.PHP_API }}.so
path: modules/timecop.so
if-no-files-found: error
- name: Save artifact (TS)
uses: actions/upload-artifact@v4
if: matrix.php-zts == 'ts'
with:
name: timecop_${{ env.PHP_API }}_zts.so
path: modules/timecop.so
if-no-files-found: error
package:
name: Package for download
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Combine artifacts
run: |
mkdir -p output
for dir in timecop_*.so; do
# Move/rename from timecop.so to timecop_PHPAPI.so
mv "${dir}/timecop.so" "output/${dir}"
done
cd output
sha256sum *.so > SHA256SUM
- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: timecop
path: output/*
if-no-files-found: error