Skip to content

Commit

Permalink
ci: Simplify version matrix
Browse files Browse the repository at this point in the history
Let’s just list version branches, we can always extract the required data from that.
This will be especially necessary once we introduce master branch, where major component of version needs to be computed.
  • Loading branch information
jtojnar committed May 15, 2022
1 parent a2cf168 commit 7c34bf1
Showing 1 changed file with 31 additions and 29 deletions.
60 changes: 31 additions & 29 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,19 @@ on:

jobs:
build:
name: 'PHP ${{ matrix.php.major }}.${{ matrix.php.minor }}'
name: 'PHP ${{ matrix.php.branch }}'
runs-on: ubuntu-20.04
strategy:
matrix:
php:
- major: 8
minor: 1
- major: 8
minor: 0
- major: 7
minor: 4
- major: 7
minor: 3
- major: 7
minor: 2
- major: 7
minor: 1
- major: 7
minor: 0
- major: 5
minor: 6
- branch: '8.1'
- branch: '8.0'
- branch: '7.4'
- branch: '7.3'
- branch: '7.2'
- branch: '7.1'
- branch: '7.0'
- branch: '5.6'
# We want to fix failures individually.
fail-fast: false
steps:
Expand All @@ -44,34 +36,44 @@ jobs:
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 "::set-output name=major::$major"
echo "::set-output name=attr::$attr"
- name: Build PHP
run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-php
run: nix-build -A outputs.checks.x86_64-linux.${{ steps.params.outputs.attr }}-php

- name: Build Imagick extension
run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-imagick
run: nix-build -A outputs.checks.x86_64-linux.${{ steps.params.outputs.attr }}-imagick

- name: Build Redis extension
run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-redis
run: nix-build -A outputs.checks.x86_64-linux.${{ steps.params.outputs.attr }}-redis

- name: Build Redis 3 extension
if: ${{ matrix.php.major < 8 }}
run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-redis3
if: ${{ steps.params.outputs.major < 8 }}
run: nix-build -A outputs.checks.x86_64-linux.${{ steps.params.outputs.attr }}-redis3

- name: Build MySQL extension
if: ${{ matrix.php.major < 7 }}
run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-mysql
if: ${{ steps.params.outputs.major < 7 }}
run: nix-build -A outputs.checks.x86_64-linux.${{ steps.params.outputs.attr }}-mysql

- name: Build Xdebug extension
run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-xdebug
run: nix-build -A outputs.checks.x86_64-linux.${{ steps.params.outputs.attr }}-xdebug

- name: Build Tidy extension
run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-tidy
run: nix-build -A outputs.checks.x86_64-linux.${{ steps.params.outputs.attr }}-tidy

- name: Check that composer PHAR works
run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-composer-phar
run: nix-build -A outputs.checks.x86_64-linux.${{ steps.params.outputs.attr }}-composer-phar

- name: Validate php.extensions.mysqli default unix socket path
run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-mysqli-socket-path
run: nix-build -A outputs.checks.x86_64-linux.${{ steps.params.outputs.attr }}-mysqli-socket-path

- name: Validate php.extensions.pdo_mysql default unix socket path
run: nix-build -A outputs.checks.x86_64-linux.php${{ matrix.php.major }}${{ matrix.php.minor }}-pdo_mysql-socket-path
run: nix-build -A outputs.checks.x86_64-linux.${{ steps.params.outputs.attr }}-pdo_mysql-socket-path

0 comments on commit 7c34bf1

Please sign in to comment.