Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,56 @@ concurrency:
cancel-in-progress: true

jobs:
setup-phpunit-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.gen.outputs.matrix }}
steps:
- uses: actions/checkout@v6
- id: gen
uses: galette/.github/actions/matrix-generator@main
with:
all-jobs: ${{ github.event_name != 'pull_request' && github.repository == 'galette/galette-events' && (github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags')) }}

setup-lint-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.gen.outputs.matrix }}
steps:
- uses: actions/checkout@v6
- id: gen
uses: galette/.github/actions/matrix-generator@main
with:
target: lint
all-jobs: ${{ github.event_name != 'pull_request' && github.repository == 'galette/galette-events' && (github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags')) }}

lint:
runs-on: ubuntu-latest
name: "Lint on PHP ${{ matrix.php-versions }}"
needs: setup-lint-matrix
name: "Lint on PHP ${{ matrix.php-version }}"

strategy:
matrix:
php-versions: [ '8.3', '8.5' ]
coverage: [none]
matrix: ${{ fromJSON(needs.setup-lint-matrix.outputs.matrix) }}
fail-fast: false

steps:
- name: PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: ${{ matrix.php-version }}
tools: composer
coverage: ${{ matrix.coverage }}

- name: Checkout Galette core
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: galette/galette
path: galette-core
fetch-depth: 1
ref: develop

- name: Checkout plugin
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
path: galette-core/galette/plugins/plugin-events

Expand All @@ -53,7 +75,7 @@ jobs:
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -70,7 +92,7 @@ jobs:
../../vendor/bin/phpcs lib/ ./*.php

- name: CS Fixer
if: matrix.php-versions == '8.3'
if: matrix.php-is-min
run: |
cd galette-core/galette/plugins/plugin-events
../../vendor/bin/php-cs-fixer check --show-progress=dots --verbose --diff
Expand Down Expand Up @@ -101,32 +123,13 @@ jobs:

unit-tests:
runs-on: ubuntu-latest
needs: setup-phpunit-matrix

strategy:
matrix:
include:
#always tests higher stable php version with lower db version
#enable coverage on higher stable php version with higher PostgreSQL version
#cache must be disabled on one always enabled build (not coverage one, this already takes much time than others)
#higher stable php version
- { php-version: "8.5", db-image: "postgres:13", coverage: none, cache: true, always: true }
- { php-version: "8.5", db-image: "postgres:17", coverage: none, cache: true, always: true }
- { php-version: "8.5", db-image: "mysql:8.0", coverage: none, cache: true, always: true }
- { php-version: "8.5", db-image: "mysql:9.1", coverage: none, cache: true, always: false }
- { php-version: "8.5", db-image: "mariadb:10.5", coverage: none, cache: false, always: true }
- { php-version: "8.5", db-image: "mariadb:11.6", coverage: none, cache: true, always: false }
#always one test with lower php version
#lower php version
- { php-version: "8.3", db-image: "postgres:13", coverage: none, cache: true, always: false }
- { php-version: "8.3", db-image: "postgres:17", coverage: none, cache: true, always: true }
- { php-version: "8.3", db-image: "mysql:8.0", coverage: none, cache: true, always: false }
- { php-version: "8.3", db-image: "mysql:9.1", coverage: none, cache: true, always: false }
- { php-version: "8.3", db-image: "mariadb:10.5", coverage: none, cache: true, always: false }
- { php-version: "8.3", db-image: "mariadb:11.6", coverage: none, cache: true, always: false }
matrix: ${{ fromJSON(needs.setup-phpunit-matrix.outputs.matrix) }}
fail-fast: false

env:
skip: ${{ matrix.always == false && (github.event_name == 'pull_request' || github.repository != 'galette/plugin-events' || !(github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags'))) }}
DB: ${{ matrix.db-image }}

services:
Expand Down Expand Up @@ -158,17 +161,15 @@ jobs:

steps:
- name: PHP
if: env.skip != 'true'
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: ${{ matrix.php-version }}
tools: composer, pecl
coverage: ${{ matrix.coverage }}
extensions: apcu
ini-values: apc.enable_cli=1

- name: "Show versions"
if: env.skip != 'true'
run: |
php --version
composer --version
Expand All @@ -177,13 +178,12 @@ jobs:
docker exec ${{ job.services.db.id }} bash -c "if [[ -n \$(command -v psql) ]]; then psql --version; else if [[ -n \$(command -v mysql) ]]; then mysql --version; else mariadb --version; fi fi"

- name: Build Galette
if: env.skip != 'true'
uses: galette/.github/actions/build-galette@main
with:
php-version: ${{ matrix.php-version }}

- name: Checkout plugin
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
path: galette-core/galette/plugins/plugin-events

Expand Down