-
Notifications
You must be signed in to change notification settings - Fork 19
94 lines (78 loc) · 3.4 KB
/
build.yaml
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
# This file builds given version of PHP and pushes it to Cachix cache.
# The following secrets need to be set:
# - “CACHIX_AUTH_TOKEN” for uploading built Nix packages to Cachix
name: Build
on:
pull_request:
push:
branches:
- master
jobs:
build:
name: "PHP ${{ matrix.php.branch }} on ${{ matrix.archs.arch }}"
runs-on: ${{ matrix.archs.os }}
strategy:
matrix:
php:
- branch: '8.3'
- branch: '8.2'
- branch: '8.1'
- branch: '8.0'
- branch: '7.4'
- branch: '7.3'
- branch: '7.2'
- branch: '7.1'
- branch: '7.0'
- branch: '5.6'
archs:
[
{ os: ubuntu-latest, arch: x86_64-linux },
{ os: macOS-latest, arch: x86_64-darwin },
]
# We want to fix failures individually.
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Set up Nix cache
uses: cachix/cachix-action@v12
with:
name: fossar
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Set job parameters
id: params
run: |
branch=${{ matrix.php.branch }}
major=${branch%%.*}
minor=${branch#*.}
attr=php$major$minor
echo "minor=$minor" >> $GITHUB_OUTPUT
echo "major=$major" >> $GITHUB_OUTPUT
echo "attr=$attr" >> $GITHUB_OUTPUT
- name: Build PHP
run: nix-build -A outputs.checks.${{ matrix.archs.arch }}.${{ steps.params.outputs.attr }}-php
- name: List extensions
run: |
nix eval --json --impure --expr 'builtins.attrNames (import ./.).packages.${{ matrix.archs.arch }}.${{ steps.params.outputs.attr }}.extensions'
- name: Build Imagick extension
run: nix-build -A outputs.checks.${{ matrix.archs.arch }}.${{ steps.params.outputs.attr }}-imagick
- name: Build Redis extension
run: nix-build -A outputs.checks.${{ matrix.archs.arch }}.${{ steps.params.outputs.attr }}-redis
- name: Build Redis 3 extension
if: ${{ steps.params.outputs.major < 8 && matrix.archs.arch == 'x86_64-linux' }}
run: nix-build -A outputs.checks.${{ matrix.archs.arch }}.${{ steps.params.outputs.attr }}-redis3
- name: Build MySQL extension
if: ${{ steps.params.outputs.major < 7 }}
run: nix-build -A outputs.checks.${{ matrix.archs.arch }}.${{ steps.params.outputs.attr }}-mysql
- name: Build Xdebug extension
if: ${{ !(steps.params.outputs.major == 8 && steps.params.outputs.minor == 3) }}
run: nix-build -A outputs.checks.${{ matrix.archs.arch }}.${{ steps.params.outputs.attr }}-xdebug
- name: Build Tidy extension
run: nix-build -A outputs.checks.${{ matrix.archs.arch }}.${{ steps.params.outputs.attr }}-tidy
- name: Check that composer PHAR works
run: nix-build -A outputs.checks.${{ matrix.archs.arch }}.${{ steps.params.outputs.attr }}-composer-phar
- name: Validate php.extensions.mysqli default unix socket path
run: nix-build -A outputs.checks.${{ matrix.archs.arch }}.${{ steps.params.outputs.attr }}-mysqli-socket-path
- name: Validate php.extensions.pdo_mysql default unix socket path
run: nix-build -A outputs.checks.${{ matrix.archs.arch }}.${{ steps.params.outputs.attr }}-pdo_mysql-socket-path