From 811d2b0931d6a76083300e9370640b75ad9d6320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Jou=C3=9Fen?= Date: Wed, 28 Feb 2024 16:08:04 +0100 Subject: [PATCH] Adjust pipeline for multiple ilias versions --- .github/workflows/ci.yaml | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 895d691..8e14e29 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,5 +1,14 @@ name: CI +env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + PLUGIN_PATH: Customizing/global/libs/ilias-plugin-utils + MATRIX: | + { + "release/7": {"php": ["7.4"], "ilias": ["release_7"]}, + "release/8": {"php": ["8.0"], "ilias": ["release_8"]} + } + on: push: branches: @@ -7,21 +16,22 @@ on: pull_request: jobs: + build-matrix: + if: "!contains(github.event.head_commit.message, '[CI SKIP]')" + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - id: set-matrix + run: echo "::set-output name=matrix::$(echo $MATRIX | jq -c --arg branch $BRANCH_NAME '.[$branch]')" + PHPUnit: - name: PHPUnit (PHP ${{ matrix.php }}) if: "!contains(github.event.head_commit.message, '[CI SKIP]')" - runs-on: ubuntu-22.04 - env: - PLUGIN_PATH: Customizing/global/libs/ilias-plugin-utils + needs: build-matrix + name: Check (ILIAS ${{ matrix.ilias }} PHP ${{ matrix.php }}) + runs-on: ubuntu-latest strategy: - matrix: - include: - - php: 7.4 - ilias: release_7 - if: BRANCH_NAME == 'release/7' - - php: 8.0 - ilias: release_8 - if: BRANCH_NAME == 'release/8' + matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} steps: - uses: actions/checkout@v4 with: