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