Skip to content

Commit

Permalink
Do not show skipped versions in tests results
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Jul 24, 2024
1 parent ee20aea commit d721c1f
Showing 1 changed file with 51 additions and 33 deletions.
84 changes: 51 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,32 +100,55 @@ jobs:
run: |
docker compose exec -T app .github/actions/lint_misc-lint.sh
generate-tests-matrix:
# Do not run scheduled tests on tier repositories
if: github.repository == 'glpi-project/glpi' || github.event_name != 'schedule'
name: "Generate tests matrix"
runs-on: "ubuntu-latest"
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
steps:
- name: "Generate matrix"
id: "generate-matrix"
run: |
if [[ "${{ github.event_name }}" = "workflow_dispatch" || ( "${{ github.ref_type }}" = "branch" && "${{ github.ref_name }}" =~ ^(main|.*/bugfixes)$ ) || "${{ github.ref_type }}" = "tag" ]]; then
MATRIX='
{
"include": [
{"php-version": "8.3", "db-image": "mariadb:11.4"},
{"php-version": "8.3", "db-image": "mysql:8.4"},
{"php-version": "8.2", "db-image": "mariadb:11.4"},
{"php-version": "8.1", "db-image": "mariadb:11.4"},
{"php-version": "8.0", "db-image": "mariadb:11.4"},
{"php-version": "7.4", "db-image": "mariadb:11.4"},
{"php-version": "8.3", "db-image": "mariadb:10.2"},
{"php-version": "8.3", "db-image": "mysql:5.7"},
{"php-version": "8.3", "db-image": "percona:8.0"},
{"php-version": "8.3", "db-image": "percona:5.7"}
]
}
'
else
MATRIX='
{
"include": [
{"php-version": "8.3", "db-image": "mariadb:11.4"},
{"php-version": "8.3", "db-image": "mysql:8.4"}
]
}
'
fi
echo "matrix=$(echo $MATRIX | jq -c .)" >> $GITHUB_OUTPUT
tests:
# Do not run scheduled tests on tier repositories
if: github.repository == 'glpi-project/glpi' || github.event_name != 'schedule'
name: "Test on PHP ${{ matrix.php-version }} using ${{ matrix.db-image }}"
needs: "generate-tests-matrix"
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
include:
# test higher PHP version with higher MariaDB and MySQL versions
- {php-version: "8.3", db-image: "mariadb:11.4", always: true}
- {php-version: "8.3", db-image: "mysql:8.4", always: true}
# test other PHP versions
- {php-version: "8.2", db-image: "mariadb:11.4", always: false}
- {php-version: "8.1", db-image: "mariadb:11.4", always: false}
- {php-version: "8.0", db-image: "mariadb:11.4", always: false}
- {php-version: "7.4", db-image: "mariadb:11.4", always: false}
# test other DB servers/versions
- {php-version: "8.3", db-image: "mariadb:10.2", always: false}
- {php-version: "8.3", db-image: "mysql:5.7", always: false}
- {php-version: "8.3", db-image: "percona:5.7", always: false}
- {php-version: "8.3", db-image: "percona:8.0", always: false}
matrix: ${{ fromJson(needs.generate-tests-matrix.outputs.matrix) }}
env:
# Skip jobs that should not be always run on pull requests or on push on tier repository (to limit workers usage).
# No jobs will be skipped on nightly build, manual dispatch or push on main branches (main and */bugfixes) or tags.
skip: ${{ matrix.always == false && (github.event_name == 'pull_request' || github.repository != 'glpi-project/glpi' || !(github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' || endsWith(github.ref, '/bugfixes') || startsWith(github.ref, 'refs/tags'))) }}
COMPOSE_FILE: ".github/actions/docker-compose-app.yml:.github/actions/docker-compose-services.yml"
APPLICATION_ROOT: "${{ github.workspace }}"
DB_IMAGE: "githubactions-${{ matrix.db-image }}"
Expand All @@ -136,10 +159,8 @@ jobs:
run: |
echo "APP_CONTAINER_HOME=${{ runner.temp }}/app_home" >> $GITHUB_ENV
- name: "Checkout"
if: env.skip != 'true'
uses: "actions/checkout@v4"
- name: "Restore dependencies cache"
if: env.skip != 'true'
uses: actions/cache@v4
with:
path: |
Expand All @@ -150,58 +171,55 @@ jobs:
app_home_deps-${{ matrix.php-version }}-
app_home_deps-
- name: "Initialize containers"
if: env.skip != 'true'
run: |
.github/actions/init_containers-start.sh
- name: "Show versions"
if: env.skip != 'true'
run: |
.github/actions/init_show-versions.sh
- name: "Build dependencies / translations"
if: env.skip != 'true'
run: |
docker compose exec -T app .github/actions/init_build.sh
- name: "Install DB tests"
if: "${{ env.skip != 'true' && (success() || failure()) }}"
if: "${{ success() || failure() }}"
run: |
docker compose exec -T app .github/actions/test_install.sh
- name: "Update DB tests (from 0.80, not using utf8mb4)"
if: "${{ env.skip != 'true' && (success() || failure()) }}"
if: "${{ success() || failure() }}"
run: |
.github/actions/init_initialize-0.80-db.sh
docker compose exec -T app .github/actions/test_update-from-older-version.sh
- name: "Update DB tests (from 9.5, using utf8mb4)"
if: "${{ env.skip != 'true' && (success() || failure()) }}"
if: "${{ success() || failure() }}"
run: |
.github/actions/init_initialize-9.5-db.sh
docker compose exec -T app .github/actions/test_update-from-9.5.sh
- name: "PHPUnit tests"
if: env.skip != 'true'
if: "${{ success() || failure() }}"
run: |
docker compose exec -T app .github/actions/test_tests-phpunit.sh
- name: "Functional tests"
if: "${{ env.skip != 'true' && (success() || failure()) }}"
if: "${{ success() || failure() }}"
run: |
docker compose exec -T app .github/actions/test_tests-functional.sh
- name: "Cache tests"
if: "${{ env.skip != 'true' && (success() || failure()) }}"
if: "${{ success() || failure() }}"
run: |
docker compose exec -T app .github/actions/test_tests-cache.sh
- name: "LDAP tests"
if: "${{ env.skip != 'true' && (success() || failure()) }}"
if: "${{ success() || failure() }}"
run: |
.github/actions/init_initialize-ldap-fixtures.sh
docker compose exec -T app .github/actions/test_tests-ldap.sh
- name: "IMAP tests"
if: "${{ env.skip != 'true' && (success() || failure()) }}"
if: "${{ success() || failure() }}"
run: |
.github/actions/init_initialize-imap-fixtures.sh
docker compose exec -T app .github/actions/test_tests-imap.sh
- name: "WEB tests"
if: "${{ env.skip != 'true' && (success() || failure()) }}"
if: "${{ success() || failure() }}"
run: |
docker compose exec -T app .github/actions/test_tests-web.sh
- name: "Javascript tests"
if: "${{ env.skip != 'true' && (success() || failure()) }}"
if: "${{ success() || failure() }}"
run: |
docker compose exec -T app .github/actions/test_javascript.sh

0 comments on commit d721c1f

Please sign in to comment.