|
8 | 8 | push:
|
9 | 9 |
|
10 | 10 | jobs:
|
| 11 | + determine-php-matrix: |
| 12 | + name: Figure out the packages we need to build |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + outputs: |
| 16 | + php: ${{ steps.set-php-matrix.outputs.php }} |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Set up Git repository |
| 20 | + uses: actions/checkout@v2 |
| 21 | + with: |
| 22 | + fetch-depth: 1 |
| 23 | + |
| 24 | + - name: Install Nix |
| 25 | + uses: cachix/install-nix-action@v17 |
| 26 | + |
| 27 | + - id: set-php-matrix |
| 28 | + run: | |
| 29 | + echo "::set-output name=php::$( |
| 30 | + nix eval --json --impure \ |
| 31 | + --expr 'builtins.attrNames (import ./.).packages.x86_64-linux' |
| 32 | + )" |
| 33 | +
|
11 | 34 | build:
|
12 |
| - name: 'PHP ${{ matrix.php.major }}.${{ matrix.php.minor }}' |
13 |
| - runs-on: ubuntu-20.04 |
| 35 | + name: "Build #${{ matrix.php }} on ${{ matrix.operating-system }}" |
| 36 | + needs: [determine-php-matrix] |
| 37 | + runs-on: ${{ matrix.operating-system }} |
14 | 38 | strategy:
|
15 |
| - matrix: |
16 |
| - php: |
17 |
| - - major: 8 |
18 |
| - minor: 1 |
19 |
| - - major: 8 |
20 |
| - minor: 0 |
21 |
| - - major: 7 |
22 |
| - minor: 4 |
23 |
| - - major: 7 |
24 |
| - minor: 3 |
25 |
| - - major: 7 |
26 |
| - minor: 2 |
27 |
| - - major: 7 |
28 |
| - minor: 1 |
29 |
| - - major: 7 |
30 |
| - minor: 0 |
31 |
| - - major: 5 |
32 |
| - minor: 6 |
33 | 39 | # We want to fix failures individually.
|
34 | 40 | fail-fast: false
|
| 41 | + matrix: |
| 42 | + php: ${{fromJson(needs.determine-php-matrix.outputs.php)}} |
| 43 | + operating-system: [ubuntu-latest, macOS-latest] |
| 44 | + |
35 | 45 | steps:
|
36 |
| - - uses: actions/checkout@v2 |
| 46 | + - name: Set up Git repository |
| 47 | + uses: actions/checkout@v2 |
| 48 | + with: |
| 49 | + fetch-depth: 1 |
37 | 50 |
|
38 | 51 | - name: Install Nix
|
39 |
| - uses: cachix/install-nix-action@v14 |
| 52 | + uses: cachix/install-nix-action@v16 |
40 | 53 |
|
41 | 54 | - name: Set up Nix cache
|
42 | 55 | uses: cachix/cachix-action@v10
|
43 | 56 | with:
|
44 | 57 | name: fossar
|
45 |
| - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' |
| 58 | + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" |
46 | 59 |
|
47 | 60 | - name: Build PHP
|
48 |
| - run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-php |
| 61 | + run: nix build .#${{ matrix.php }} |
49 | 62 |
|
50 | 63 | - name: Build Imagick extension
|
51 |
| - run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-imagick |
| 64 | + run: nix build .#${{ matrix.php }}.extensions.imagick |
52 | 65 |
|
53 | 66 | - name: Build Redis extension
|
54 |
| - run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-redis |
| 67 | + run: nix build .#${{ matrix.php }}.extensions.redis |
55 | 68 |
|
56 | 69 | - name: Build Redis 3 extension
|
57 |
| - if: ${{ matrix.php.major < 8 }} |
58 |
| - run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-redis3 |
| 70 | + continue-on-error: true |
| 71 | + run: nix build .#${{ matrix.php }}.extensions.redis3 |
59 | 72 |
|
60 | 73 | - name: Build MySQL extension
|
61 |
| - if: ${{ matrix.php.major < 7 }} |
62 |
| - run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-mysql |
| 74 | + continue-on-error: true |
| 75 | + run: nix build .#${{ matrix.php }}.extensions.mysql |
63 | 76 |
|
64 | 77 | - name: Build Xdebug extension
|
65 |
| - run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-xdebug |
| 78 | + run: nix build .#${{ matrix.php }}.extensions.xdebug |
66 | 79 |
|
67 | 80 | - name: Build Tidy extension
|
68 |
| - run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-tidy |
| 81 | + run: nix build .#${{ matrix.php }}.extensions.tidy |
69 | 82 |
|
70 | 83 | - name: Check that composer PHAR works
|
71 |
| - run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-composer-phar |
| 84 | + run: | |
| 85 | + nix develop --impure --expr ' |
| 86 | + let |
| 87 | + self = import ./.; |
| 88 | + composer = |
| 89 | + self.outputs.packages.${builtins.currentSystem}.${{ matrix.php }}.packages.composer; |
| 90 | + pkgs = import self.inputs.nixpkgs { }; |
| 91 | + in |
| 92 | + pkgs.mkShell { |
| 93 | + packages = [ |
| 94 | + composer |
| 95 | + ]; |
| 96 | + } |
| 97 | + ' -c composer --version |
72 | 98 |
|
73 | 99 | - name: Validate php.extensions.mysqli default unix socket path
|
74 |
| - run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-mysqli-socket-path |
| 100 | + run: | |
| 101 | + nix develop --impure --expr ' |
| 102 | + let |
| 103 | + self = import ./.; |
| 104 | + php = |
| 105 | + self.outputs.packages.${builtins.currentSystem}.${{ matrix.php }}.withExtensions |
| 106 | + ({ all, ... }: [ all.mysqli ]); |
| 107 | + pkgs = import self.inputs.nixpkgs { }; |
| 108 | + in |
| 109 | + pkgs.mkShell { |
| 110 | + packages = [ |
| 111 | + php |
| 112 | + ]; |
| 113 | + } |
| 114 | + ' -c php -r "echo ini_get('mysqli.default_socket') . PHP_EOL;" | grep /run/mysqld/mysqld.sock |
75 | 115 |
|
76 | 116 | - name: Validate php.extensions.pdo_mysql default unix socket path
|
77 |
| - run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-pdo_mysql-socket-path |
| 117 | + run: | |
| 118 | + nix develop --impure --expr ' |
| 119 | + let |
| 120 | + self = import ./.; |
| 121 | + php = |
| 122 | + self.outputs.packages.${builtins.currentSystem}.${{ matrix.php }}.withExtensions |
| 123 | + ({ all, ... }: [ all.pdo_mysql ]); |
| 124 | + pkgs = import self.inputs.nixpkgs { }; |
| 125 | + in |
| 126 | + pkgs.mkShell { |
| 127 | + packages = [ |
| 128 | + php |
| 129 | + ]; |
| 130 | + } |
| 131 | + ' -c php -r "echo ini_get('pdo_mysql.default_socket') . PHP_EOL;" | grep /run/mysqld/mysqld.sock |
0 commit comments