Skip to content

[dependabot][ghaction] - (deps): Bump the all-actions group with 3 updates #611

[dependabot][ghaction] - (deps): Bump the all-actions group with 3 updates

[dependabot][ghaction] - (deps): Bump the all-actions group with 3 updates #611

Workflow file for this run

name: 'CI'
on: # Build any PRs and main branch changes
workflow_dispatch: # Allows to run the workflow manually from the Actions tab
pull_request:
types:
- opened
- edited
- synchronize
push:
branches: [ master ]
schedule:
- cron: '0 0 1 * *' # Every month
concurrency:
group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}"
cancel-in-progress: true
env:
TEST_OUTPUT_STYLE: pretty
COMPOSER_OPTIONS: --optimize-autoloader
CODACY_CACHE_PATH: ~/.cache/codacy
CODACY_BIN: ~/.cache/codacy/codacy.sh
jobs:
## Untrusted >>>
debug-context:
name: DEBUG - context
runs-on: ubuntu-latest
steps:
- run: |
echo '{'
echo '"github.action": ${{ toJson(github.action) }},'
echo '"github.action_path": ${{ toJson(github.action_path) }},'
echo '"github.action_ref": ${{ toJson(github.action_ref) }},'
echo '"github.action_repository": ${{ toJson(github.action_repository) }},'
echo '"github.action_status": ${{ toJson(github.action_status) }},'
echo '"github.actor": ${{ toJson(github.actor) }},'
echo '"github.actor_id": ${{ toJson(github.actor_id) }},'
echo '"github.base_ref": ${{ toJson(github.base_ref) }},'
echo '"github.event": ${{ toJson(github.event) }},'
echo '"github.event_name": ${{ toJson(github.event_name) }},'
echo '"github.event_path": ${{ toJson(github.event_path) }},'
echo '"github.head_ref": ${{ toJson(github.head_ref) }},'
echo '"github.job": ${{ toJson(github.job) }},'
echo '"github.path": ${{ toJson(github.path) }},'
echo '"github.ref": ${{ toJson(github.ref) }},'
echo '"github.ref_name": ${{ toJson(github.ref_name) }},'
echo '"github.ref_protected": ${{ toJson(github.ref_protected) }},'
echo '"github.ref_type": ${{ toJson(github.ref_type) }},'
echo '"github.repository": ${{ toJson(github.repository) }},'
echo '"github.repository_id": ${{ toJson(github.repository_id) }},'
echo '"github.repository_owner": ${{ toJson(github.repository_owner) }},'
echo '"github.repository_owner_id": ${{ toJson(github.repository_owner_id) }},'
echo '"github.repositoryUrl": ${{ toJson(github.repositoryUrl) }},'
echo '"github.run_id": ${{ toJson(github.run_id) }},'
echo '"github.run_number": ${{ toJson(github.run_number) }},'
echo '"github.run_attempt": ${{ toJson(github.run_attempt) }},'
echo '"github.sha": ${{ toJson(github.sha) }},'
echo '"github.triggering_actor": ${{ toJson(github.triggering_actor) }},'
echo '"github.workflow": ${{ toJson(github.workflow) }},'
echo '"github.workflow_ref": ${{ toJson(github.workflow_ref) }},'
echo '"github.workflow_sha": ${{ toJson(github.workflow_sha) }},'
echo '"github.workspace": ${{ toJson(github.workspace) }}'
echo '}'
tests:
name: UTs & FTs - PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
env:
COVERAGE_TYPE: xdebug
COVERAGE_OUTPUT_STYLE: clover
strategy:
fail-fast: true
max-parallel: 4
matrix:
include:
# Bare minimum => Lowest versions allowed by composer config
- php-version: '8.0'
composer-flag: --prefer-lowest
# Up-to-date versions => Latest versions allowed by composer config
- php-version: '8.2'
steps:
- name: Check out code
uses: actions/checkout@v4
# @TODO Figure out if coverage for every version is actually useful or not
# - name: Enable coverage
# if: ${{ matrix.php-version == '8.2' }}
# run: |
# echo "COVERAGE_OUTPUT_STYLE=clover" >> $GITHUB_ENV
# echo "COVERAGE_TYPE=xdebug" >> $GITHUB_ENV
- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
env:
update: true # Always use latest available patch for the version
fail-fast: true # step will fail if an extension or tool fails to set up
with:
php-version: '${{ matrix.php-version }}'
tools: composer
coverage: ${{ env.COVERAGE_TYPE }}
- name: Setup cache
id: cache
uses: actions/cache@v4
with:
path: |
~/.composer
./vendor
# Clear the cache if composer json (as composer.lock is in the repo) has been updated
key: tests-${{ matrix.php-version }}-${{ matrix.composer-flag }}-${{ hashFiles('composer.json') }}
- name: Build
run: |
make build
- name: Tests
run: make test-unit && make test-functional
# @TODO move reports-group/create-action action to a dedicated repo
- name: Create "unit tests" reports directory
if: ${{ env.COVERAGE_TYPE == 'xdebug' }}
id: unit-tests-coverage-group
uses: ./.github/actions/reports-group/create-action
with:
name: unit-tests
format: clover
files: build/coverage-phpunit/unit.clover
flags: |
unit-tests
php-${{ matrix.php-version }}
path: build/coverage-groups
# @TODO move reports-group/create-action action to a dedicated repo
- name: Create "functional tests" coverage group
if: ${{ env.COVERAGE_TYPE == 'xdebug' }}
id: functional-tests-coverage-group
uses: ./.github/actions/reports-group/create-action
with:
name: functional-tests
format: clover
files: |
build/coverage-phpunit/functional.clover
build/coverage-behat/clover.xml
flags: |
functional-tests
php-${{ matrix.php-version }}
path: build/coverage-groups
- name: Upload coverage reports
if: ${{ env.COVERAGE_TYPE == 'xdebug' }}
uses: actions/upload-artifact@v4
with:
name: coverage-groups-php${{ matrix.php-version }}
path: build/coverage-groups
if-no-files-found: error
static-checks:
name: Static checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP 8.2
uses: shivammathur/setup-php@v2
with:
php-version: 8.2 # Latest supported
tools: composer
coverage: none
env:
# Always use latest available patch for the version
update: true
- name: Setup cache
id: cache
uses: actions/cache@v4
with:
path: |
~/.composer
# Clear the cache if composer json (as composer.lock is in the repo) has been updated
key: tests-${{ env.PHP_VERSION }}-${{ hashFiles('composer.json') }}
- name: Build
run: make build
- name: ComposerRequireChecker
uses: docker://webfactory/composer-require-checker:4.5.0
- name: Dependencies check
if: ${{ github.event_name == 'pull_request' }}
uses: actions/dependency-review-action@v4
nightly-tests:
name: Nightly - PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
env:
COMPOSER_OPTIONS: '--optimize-autoloader --ignore-platform-req=php+'
continue-on-error: true
needs: [ static-checks, tests ]
strategy:
fail-fast: false
max-parallel: 4
matrix:
php-version:
- '8.3' # Current php dev version
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php-version }}'
tools: composer
coverage: none
env:
# Always use latest available patch for the version
update: true
- name: Setup cache
id: cache
uses: actions/cache@v4
with:
path: |
~/.composer
./vendor
# Clear the cache if composer json (as composer.lock is in the repo) has been updated
key: tests-${{ matrix.php-version }}-${{ hashFiles('composer.json') }}
- name: Build
run: |
make build
- name: Test
run: make test-unit && make test-functional
## <<< Untrusted
## Trusted - to move to a workflow_run workflow >>>
fetch-info:
name: Fetch triggering workflow metadata
runs-on: ubuntu-latest
needs: [tests]
permissions:
contents: read
checks: write # For the check run creation !
outputs:
commit-sha: ${{ steps.fetch-workflow-metadata.outputs.commit-sha }}
run-id: ${{ steps.fetch-workflow-metadata.outputs.run-id }}
steps:
# @TODO move actions to a dedicated repo and remove the checkout
- uses: actions/checkout@v4
with:
path: custom-action-repo
- uses: ./custom-action-repo/.github/actions/reports-group/attach-check-run-to-triggering-workflow-action
with:
github-token: ${{ github.token }}
job-status: ${{ job.status }}
fails-on-triggering-workflow-failure: true
- uses: ./custom-action-repo/.github/actions/reports-group/fetch-workflow-metadata-action
id: fetch-workflow-metadata
codacy-uploader:
name: Codacy
needs: [fetch-info]
uses: ./.github/workflows/codacy-upload-from-artifacts.yml
with:
artifacts-pattern: coverage-groups-*
run-id: ${{ needs.fetch-info.outputs.run-id }}
override-commit: ${{ needs.fetch-info.outputs.commit-sha }}
permissions:
contents: read
checks: write # For the check run creation !
secrets:
PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
codecov-uploader:
name: Codecov
needs: [fetch-info]
uses: ./.github/workflows/codecov-upload-from-artifacts.yml
with:
artifacts-pattern: coverage-groups-*
run-id: ${{ needs.fetch-info.outputs.run-id }}
override-commit: ${{ needs.fetch-info.outputs.commit-sha }}
permissions:
contents: read
checks: write # For the check run creation !
secrets:
TOKEN: ${{ secrets.CODECOV_TOKEN }}
debug-uploads:
name: DEBUG - Uploaders
runs-on: ubuntu-latest
needs: [ codacy-uploader, codecov-uploader ]
steps:
- run: echo 'codecov='"'"'${{ toJson(needs.codecov-uploader) }}'"'"
- run: echo 'codacy='"'"'${{ toJson(needs.codacy-uploader) }}'"'"
## <<< Trusted - to move to a workflow_run workflow