xref: /PHP-8.1/.github/workflows/push.yml (revision 560a5851)
1name: Push
2on:
3  push:
4    paths-ignore:
5      - docs/*
6      - NEWS
7      - UPGRADING
8      - UPGRADING.INTERNALS
9      - '**/README.*'
10      - CONTRIBUTING.md
11      - CODING_STANDARDS.md
12      - .cirrus.yml
13      - .travis.yml
14      - travis/*
15      - .circleci/*
16    branches:
17      - PHP-7.4
18      - PHP-8.0
19      - PHP-8.1
20      - master
21  pull_request:
22    paths-ignore:
23      - docs/*
24      - NEWS
25      - UPGRADING
26      - UPGRADING.INTERNALS
27      - '**/README.*'
28      - CONTRIBUTING.md
29      - CODING_STANDARDS.md
30      - .cirrus.yml
31      - .travis.yml
32      - travis/*
33      - .circleci/*
34    branches:
35      - '**'
36  workflow_dispatch: ~
37concurrency:
38  group: ${{ github.workflow }}-${{ github.event.pull_request.url || github.run_id }}
39  cancel-in-progress: true
40env:
41  CC: ccache gcc
42  CXX: ccache g++
43jobs:
44  LINUX_X64:
45    if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
46    services:
47      mysql:
48        image: mysql:8.3
49        ports:
50          - 3306:3306
51        env:
52          MYSQL_DATABASE: test
53          MYSQL_ROOT_PASSWORD: root
54      postgres:
55        image: postgres
56        ports:
57          - 5432:5432
58        env:
59          POSTGRES_USER: postgres
60          POSTGRES_PASSWORD: postgres
61          POSTGRES_DB: test
62    strategy:
63      fail-fast: false
64      matrix:
65        include:
66          - debug: true
67            zts: false
68          - debug: false
69            zts: true
70    name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
71    runs-on: ubuntu-20.04
72    steps:
73      - name: git checkout
74        uses: actions/checkout@v4
75      - name: Create MSSQL container
76        uses: ./.github/actions/setup-mssql
77      - name: Create Oracle container
78        uses: ./.github/actions/setup-oracle
79      - name: Setup Caddy server
80        uses: ./.github/actions/setup-caddy
81      - name: apt
82        uses: ./.github/actions/apt-x64
83      - name: ccache
84        uses: hendrikmuhs/ccache-action@v1.2
85        with:
86          # This duplicates the "job.name" expression above because
87          # GitHub has no way to query the job name (github.job is the
88          # job id, not the job name)
89          key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}-${{hashFiles('main/php_version.h')}}"
90          append-timestamp: false
91      - name: ./configure
92        uses: ./.github/actions/configure-x64
93        with:
94          configurationParameters: >-
95            --${{ matrix.debug && 'enable' || 'disable' }}-debug
96            --${{ matrix.zts && 'enable' || 'disable' }}-zts
97      - name: make
98        run: make -j$(/usr/bin/nproc) >/dev/null
99      - name: make install
100        uses: ./.github/actions/install-linux
101      - name: Setup
102        uses: ./.github/actions/setup-x64
103      - name: Test
104        uses: ./.github/actions/test-linux
105      - name: Test Tracing JIT
106        uses: ./.github/actions/test-linux
107        with:
108          jitType: tracing
109          runTestsParameters: >-
110            -d zend_extension=opcache.so
111            -d opcache.enable_cli=1
112      - name: Verify generated files are up to date
113        uses: ./.github/actions/verify-generated-files
114  MACOS_DEBUG_NTS:
115    if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
116    runs-on: macos-13
117    steps:
118      - name: git checkout
119        uses: actions/checkout@v4
120      - name: brew
121        uses: ./.github/actions/brew
122      - name: ccache
123        uses: hendrikmuhs/ccache-action@v1.2
124        with:
125          key: "${{github.job}}-${{hashFiles('main/php_version.h')}}"
126          append-timestamp: false
127      - name: ./configure
128        uses: ./.github/actions/configure-macos
129        with:
130          configurationParameters: --enable-debug --disable-zts
131      - name: make
132        run: |-
133          export PATH="/usr/local/opt/bison/bin:$PATH"
134          make -j$(sysctl -n hw.logicalcpu) >/dev/null
135      - name: make install
136        run: sudo make install
137      - name: Test Tracing JIT
138        uses: ./.github/actions/test-macos
139        with:
140          jitType: tracing
141          runTestsParameters: >-
142            -d zend_extension=opcache.so
143            -d opcache.enable_cli=1
144            -d opcache.protect_memory=1
145      - name: Verify generated files are up to date
146        uses: ./.github/actions/verify-generated-files
147  WINDOWS:
148    if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
149    name: WINDOWS_X64_ZTS
150    runs-on: windows-2019
151    env:
152      PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
153      PHP_BUILD_OBJ_DIR: C:\obj
154      PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk
155      PHP_BUILD_SDK_BRANCH: php-sdk-2.3.0
156      PHP_BUILD_CRT: vs16
157      PLATFORM: x64
158      THREAD_SAFE: "1"
159      INTRINSICS: AVX2
160      PARALLEL: -j2
161      OPCACHE: "1"
162    steps:
163      - name: git config
164        run: git config --global core.autocrlf false && git config --global core.eol lf
165      - name: git checkout
166        uses: actions/checkout@v4
167      - name: Setup
168        uses: ./.github/actions/setup-windows
169      - name: Build
170        run: .github/scripts/windows/build.bat
171      - name: Test
172        run: .github/scripts/windows/test.bat
173