-
-
Notifications
You must be signed in to change notification settings - Fork 27
117 lines (103 loc) · 3.55 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Build
on:
push:
branches: [master]
pull_request:
release:
types: [created]
schedule:
- cron: '0 4 * * *'
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# for phive
GITHUB_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
jobs:
tests:
runs-on: ubuntu-latest
name: Build and test
strategy:
matrix:
php: [8.1, 8.2, 8.3, 8.4]
deps: [high]
include:
- php: 8.1
deps: low
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
tools: composer
ini-values: "phar.readonly=0"
coverage: pcov
- if: matrix.deps == 'high'
run: make update test package package-devkit
- if: matrix.deps == 'low'
run: make update-min test-min
- uses: actions/upload-artifact@v4
if: matrix.php == '8.1' && matrix.deps == 'high'
with:
name: toolbox.phar
path: build/toolbox.phar
- uses: actions/upload-artifact@v4
if: matrix.php == '8.1' && matrix.deps == 'high'
with:
name: devkit.phar
path: build/devkit.phar
integration-tests:
runs-on: ubuntu-latest
name: Run integration tests
needs: tests
strategy:
matrix:
php: [8.1, 8.2, 8.3, 8.4]
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
tools: composer
ini-values: "phar.readonly=0"
coverage: none
extensions: bz2, zip
- uses: actions/download-artifact@v4
with:
name: toolbox.phar
path: build/
- run: make test-integration
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-phars:
runs-on: ubuntu-latest
name: Publish PHARs
needs: tests
if: github.event_name == 'release'
steps:
- uses: actions/download-artifact@v4
with:
name: toolbox.phar
path: .
- uses: actions/download-artifact@v4
with:
name: devkit.phar
path: .
- name: Upload toolbox.phar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./toolbox.phar
asset_name: toolbox.phar
asset_content_type: application/zip
- name: Upload devkit.phar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./devkit.phar
asset_name: devkit.phar
asset_content_type: application/zip