xref: /php-src/.github/workflows/root.yml (revision 3b609ab0)
1name: Nightly
2on:
3  schedule:
4   - cron: "0 1 * * *"
5  workflow_dispatch: ~
6permissions:
7  contents: read
8jobs:
9  GENERATE_MATRIX:
10    name: Generate Matrix
11    if: github.repository == 'php/php-src' || github.event_name == 'workflow_dispatch'
12    runs-on: ubuntu-latest
13    outputs:
14      branches: ${{ steps.set-matrix.outputs.branches }}
15    steps:
16      - uses: actions/checkout@v4
17        with:
18          # Set fetch-depth to 0 to clone the full repository
19          # including all branches. This is required to find
20          # the correct commit hashes.
21          fetch-depth: 0
22      - name: Grab the commit mapping
23        uses: actions/cache@v4
24        with:
25          path: branch-commit-cache.json
26          # The cache key needs to change every time for the
27          # cache to be updated after this job finishes.
28          key: nightly-${{ github.run_id }}-${{ github.run_attempt }}
29          restore-keys: |
30            nightly-
31      - name: Generate Matrix
32        id: set-matrix
33        run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.head_ref || github.ref_name }}"
34      - name: Notify Slack
35        if: failure()
36        uses: ./.github/actions/notify-slack
37        with:
38          token: ${{ secrets.ACTION_MONITORING_SLACK }}
39  NIGHTLY:
40    needs: GENERATE_MATRIX
41    name: ${{ matrix.branch.ref }}
42    if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
43    uses: ./.github/workflows/nightly.yml
44    strategy:
45      fail-fast: false
46      matrix:
47        branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
48    with:
49      asan_ubuntu_version: ${{
50        (((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '24.04')
51        || '20.04' }}
52      branch: ${{ matrix.branch.ref }}
53      community_verify_type_inference: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }}
54      libmysqlclient_with_mysqli: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1) }}
55      run_alpine: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }}
56      run_macos_arm64: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }}
57      ubuntu_version: ${{
58        (((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '24.04')
59        || ((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 3) && '22.04')
60        || '20.04' }}
61      windows_version: ${{ ((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9) && '2022' || '2019' }}
62    secrets: inherit
63