Skip to content

[CI] Combine push and root #1

[CI] Combine push and root

[CI] Combine push and root #1

Workflow file for this run

name: Test

Check failure on line 1 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/test.yml

Invalid workflow file

(Line: 62, Col: 14): Unexpected symbol: '['. Located at position 44 within expression: toJSON(github.event.pull_request.labels || [])
on:
push:
paths-ignore: &ignore_paths
- docs/**
- NEWS
- UPGRADING
- UPGRADING.INTERNALS
- '**/README.*'
- CONTRIBUTING.md
- CODING_STANDARDS.md
- .cirrus.yml
- .circleci/**
branches:
- PHP-8.2
- PHP-8.3
- PHP-8.4
- PHP-8.5
- master
pull_request:
paths-ignore: *ignore_paths
branches:
- '**'
schedule:
- cron: "0 1 * * *"
workflow_dispatch: ~
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.url || github.run_id }}
cancel-in-progress: true
env:
CC: ccache gcc
CXX: ccache g++
jobs:
GENERATE_MATRIX:
name: Generate Matrix
if: github.repository == 'php/php-src' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
outputs:
all_variations: ${{ steps.set-matrix.outputs.all_variations }}
branches: ${{ steps.set-matrix.outputs.branches }}
steps:
- uses: actions/checkout@v6
with:
# When running nightly, set fetch-depth to 0 to clone the full
# repository including all branches. This is required to find the
# correct commit hashes.
fetch-depth: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 0 || 1 }}
- name: Grab the commit mapping
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
uses: actions/cache@v5
with:
path: branch-commit-cache.json
# The cache key needs to change every time for the
# cache to be updated after this job finishes.
key: nightly-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
nightly-
- name: Generate Matrix
id: set-matrix
run: php .github/matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" '${{ toJSON(github.event.pull_request.labels || []) }}' "${{ github.repository }}"
PUSH:
needs: GENERATE_MATRIX
name: ${{ matrix.branch.ref }}
uses: ./.github/workflows/test-suite.yml
strategy:
fail-fast: false
matrix:
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
with:
all_variations: ${{ needs.GENERATE_MATRIX.outputs.all_variations == 'true' }}
branch: ${{ toJSON(matrix.branch) }}
secrets: inherit