Skip to content

Commit d98963a

Browse files
committed
Switch to Ubuntu 22.04 for GitHub actions jobs
Closes GH-10814
1 parent 08e7366 commit d98963a

File tree

11 files changed

+88
-20
lines changed

11 files changed

+88
-20
lines changed

.github/actions/setup-x64/action.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,14 @@ runs:
77
set -x
88
99
sudo service mysql start
10-
sudo service postgresql start
1110
sudo service slapd start
1211
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
1312
# Ensure local_infile tests can run.
1413
mysql -uroot -proot -e "SET GLOBAL local_infile = true"
15-
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
16-
sudo -u postgres psql -c "CREATE DATABASE test;"
1714
docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "<YourStrong@Passw0rd>" -Q "create login pdo_test with password='password', check_policy=off; create user pdo_test for login pdo_test; grant alter, control to pdo_test;"
1815
sudo locale-gen de_DE
1916
20-
./.github/scripts/setup-slapd.sh &>/dev/null
17+
./.github/scripts/setup-slapd.sh
2118
2219
sudo cp ext/snmp/tests/snmpd.conf /etc/snmp
2320
sudo cp ext/snmp/tests/bigtest /etc/snmp

.github/actions/test-linux/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ runs:
2828
export PDO_OCI_TEST_USER="system"
2929
export PDO_OCI_TEST_PASS="pass"
3030
export PDO_OCI_TEST_DSN="oci:dbname=localhost/XEPDB1;charset=AL32UTF8"
31+
export PGSQL_TEST_CONNSTR="host=postgres dbname=test port=5432 user=postgres password=postgres"
32+
export PDO_PGSQL_TEST_DSN="host=postgres dbname=test port=5432 user=postgres password=postgres"
3133
export SKIP_IO_CAPTURE_TESTS=1
3234
export TEST_PHP_JUNIT=junit.out.xml
3335
export STACK_LIMIT_DEFAULTS_CHECK=1

.github/scripts/setup-slapd.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
set -ex
2+
set -e
33

44
# Create TLS certificate
55
sudo mkdir -p /etc/ldap/ssl
@@ -42,8 +42,6 @@ sudo sed -e 's|^\s*SLAPD_SERVICES\s*=.*$|SLAPD_SERVICES="ldap:/// ldaps:/// ldap
4242
# Configure LDAP database.
4343
DBDN=`sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config '(&(olcRootDN=*)(olcSuffix=*))' dn | grep -i '^dn:' | sed -e 's/^dn:\s*//'`;
4444

45-
sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/ppolicy.ldif
46-
4745
sudo service slapd restart
4846

4947
sudo ldapmodify -Q -Y EXTERNAL -H ldapi:/// << EOF

.github/workflows/nightly.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ jobs:
3535
LINUX_X64:
3636
needs: GENERATE_MATRIX
3737
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
38+
services:
39+
postgres:
40+
image: postgres
41+
env:
42+
POSTGRES_USER: postgres
43+
POSTGRES_PASSWORD: postgres
44+
POSTGRES_DB: test
3845
strategy:
3946
fail-fast: false
4047
matrix:
@@ -47,7 +54,7 @@ jobs:
4754
zts: [true, false]
4855
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.matrix-include) }}
4956
name: "${{ matrix.branch.name }}_LINUX_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
50-
runs-on: ubuntu-20.04
57+
runs-on: ubuntu-22.04
5158
steps:
5259
- name: git checkout
5360
uses: actions/checkout@v3
@@ -122,7 +129,7 @@ jobs:
122129
name: "${{ matrix.branch.name }}_LINUX_X32_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
123130
runs-on: ubuntu-latest
124131
container:
125-
image: ubuntu:20.04
132+
image: ubuntu:22.04
126133
env:
127134
MYSQL_TEST_HOST: mysql
128135
PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test
@@ -246,7 +253,14 @@ jobs:
246253
uses: ./.github/actions/verify-generated-files
247254
COVERAGE_DEBUG_NTS:
248255
if: github.repository_owner == 'php' || github.event_name == 'workflow_dispatch'
249-
runs-on: ubuntu-20.04
256+
services:
257+
postgres:
258+
image: postgres
259+
env:
260+
POSTGRES_USER: postgres
261+
POSTGRES_PASSWORD: postgres
262+
POSTGRES_DB: test
263+
runs-on: ubuntu-22.04
250264
steps:
251265
- name: git checkout
252266
uses: actions/checkout@v3
@@ -286,7 +300,7 @@ jobs:
286300
matrix:
287301
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
288302
name: "${{ matrix.branch.name }}_COMMUNITY"
289-
runs-on: ubuntu-20.04
303+
runs-on: ubuntu-22.04
290304
env:
291305
UBSAN_OPTIONS: print_stacktrace=1
292306
USE_ZEND_ALLOC: 0
@@ -396,12 +410,19 @@ jobs:
396410
OPCACHE_VARIATION:
397411
needs: GENERATE_MATRIX
398412
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
413+
services:
414+
postgres:
415+
image: postgres
416+
env:
417+
POSTGRES_USER: postgres
418+
POSTGRES_PASSWORD: postgres
419+
POSTGRES_DB: test
399420
strategy:
400421
fail-fast: false
401422
matrix:
402423
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
403424
name: "${{ matrix.branch.name }}_OPCACHE_VARIATION"
404-
runs-on: ubuntu-20.04
425+
runs-on: ubuntu-22.04
405426
steps:
406427
- name: git checkout
407428
uses: actions/checkout@v3
@@ -567,7 +588,7 @@ jobs:
567588
exclude:
568589
- branch: { name: 'PHP-80', ref: 'PHP-8.0' }
569590
name: "${{ matrix.branch.name }}_LIBMYSQLCLIENT"
570-
runs-on: ubuntu-20.04
591+
runs-on: ubuntu-22.04
571592
steps:
572593
- name: git checkout
573594
uses: actions/checkout@v3
@@ -614,7 +635,7 @@ jobs:
614635
uses: ./.github/actions/verify-generated-files
615636
PECL:
616637
if: github.repository_owner == 'php' || github.event_name == 'workflow_dispatch'
617-
runs-on: ubuntu-20.04
638+
runs-on: ubuntu-22.04
618639
env:
619640
CC: ccache gcc
620641
CXX: ccache g++

.github/workflows/push.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ env:
2828
CXX: ccache g++
2929
jobs:
3030
LINUX_X64:
31+
services:
32+
postgres:
33+
image: postgres
34+
env:
35+
POSTGRES_USER: postgres
36+
POSTGRES_PASSWORD: postgres
37+
POSTGRES_DB: test
3138
strategy:
3239
fail-fast: false
3340
matrix:
@@ -37,7 +44,7 @@ jobs:
3744
- debug: false
3845
zts: true
3946
name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
40-
runs-on: ubuntu-20.04
47+
runs-on: ubuntu-22.04
4148
steps:
4249
- name: git checkout
4350
uses: actions/checkout@v3
@@ -85,7 +92,7 @@ jobs:
8592
name: LINUX_X32_DEBUG_ZTS
8693
runs-on: ubuntu-latest
8794
container:
88-
image: ubuntu:20.04
95+
image: ubuntu:22.04
8996
env:
9097
MYSQL_TEST_HOST: mysql
9198
PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test

Zend/zend_portability.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,4 +737,17 @@ extern "C++" {
737737
# define ZEND_INDIRECT_RETURN
738738
#endif
739739

740+
#if __GNUC__ && !defined(__clang__)
741+
# define __DO_PRAGMA(x) _Pragma(#x)
742+
# define _DO_PRAGMA(x) __DO_PRAGMA(x)
743+
# define ZEND_CGG_DIAGNOSTIC_IGNORED_START(warning) \
744+
_Pragma("GCC diagnostic push") \
745+
_DO_PRAGMA(GCC diagnostic ignored warning)
746+
# define ZEND_CGG_DIAGNOSTIC_IGNORED_END \
747+
_Pragma("GCC diagnostic pop")
748+
#else
749+
# define ZEND_CGG_DIAGNOSTIC_IGNORED_START(warning)
750+
# define ZEND_CGG_DIAGNOSTIC_IGNORED_END
751+
#endif
752+
740753
#endif /* ZEND_PORTABILITY_H */

ext/imap/php_imap.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,11 +525,9 @@ PHP_RINIT_FUNCTION(imap)
525525
}
526526
/* }}} */
527527

528-
/* {{{ PHP_RSHUTDOWN_FUNCTION */
529-
PHP_RSHUTDOWN_FUNCTION(imap)
528+
static void free_errorlist(void)
530529
{
531530
ERRORLIST *ecur = NIL;
532-
STRINGLIST *acur = NIL;
533531

534532
if (IMAPG(imap_errorstack) != NIL) {
535533
/* output any remaining errors at their original error level */
@@ -545,6 +543,11 @@ PHP_RSHUTDOWN_FUNCTION(imap)
545543
mail_free_errorlist(&IMAPG(imap_errorstack));
546544
IMAPG(imap_errorstack) = NIL;
547545
}
546+
}
547+
548+
static void free_stringlist(void)
549+
{
550+
STRINGLIST *acur = NIL;
548551

549552
if (IMAPG(imap_alertstack) != NIL) {
550553
/* output any remaining alerts at E_NOTICE level */
@@ -560,6 +563,13 @@ PHP_RSHUTDOWN_FUNCTION(imap)
560563
mail_free_stringlist(&IMAPG(imap_alertstack));
561564
IMAPG(imap_alertstack) = NIL;
562565
}
566+
}
567+
568+
/* {{{ PHP_RSHUTDOWN_FUNCTION */
569+
PHP_RSHUTDOWN_FUNCTION(imap)
570+
{
571+
free_errorlist();
572+
free_stringlist();
563573
return SUCCESS;
564574
}
565575
/* }}} */

ext/imap/php_imap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
# endif
4848

4949
/* these are used for quota support */
50+
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
5051
# include "c-client.h" /* includes mail.h and rfc822.h */
52+
ZEND_CGG_DIAGNOSTIC_IGNORED_END
5153
# include "imap4r1.h" /* location of c-client quota functions */
5254
#else
5355
# include "mail.h"

ext/oci8/php_oci8_int.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
/* }}} */
5454

5555
#include "ext/standard/php_string.h"
56+
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
5657
#include <oci.h>
58+
ZEND_CGG_DIAGNOSTIC_IGNORED_END
5759

5860
#if !defined(OCI_MAJOR_VERSION) || OCI_MAJOR_VERSION < 11 || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION < 2))
5961
#error This version of PHP OCI8 requires Oracle Client libraries from 11.2 or later.

ext/pdo_oci/php_pdo_oci_int.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414
+----------------------------------------------------------------------+
1515
*/
1616

17+
#ifndef PHP_PDO_OCI_INT_H
18+
#define PHP_PDO_OCI_INT_H
19+
20+
#include "zend_portability.h"
21+
22+
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
1723
#include <oci.h>
24+
ZEND_CGG_DIAGNOSTIC_IGNORED_END
1825

1926
typedef struct {
2027
const char *file;
@@ -105,3 +112,5 @@ enum {
105112
PDO_OCI_ATTR_MODULE,
106113
PDO_OCI_ATTR_CALL_TIMEOUT
107114
};
115+
116+
#endif /* PHP_PDO_OCI_INT_H */

ext/soap/php_encoding.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2386,7 +2386,14 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
23862386
if (style == SOAP_ENCODED) {
23872387
if (soap_version == SOAP_1_1) {
23882388
smart_str_0(&array_type);
2389-
if (strcmp(ZSTR_VAL(array_type.s),"xsd:anyType") == 0) {
2389+
#if defined(__GNUC__) && __GNUC__ >= 11
2390+
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstringop-overread")
2391+
#endif
2392+
bool is_xsd_any_type = strcmp(ZSTR_VAL(array_type.s),"xsd:anyType") == 0;
2393+
#if defined(__GNUC__) && __GNUC__ >= 11
2394+
ZEND_CGG_DIAGNOSTIC_IGNORED_END
2395+
#endif
2396+
if (is_xsd_any_type) {
23902397
smart_str_free(&array_type);
23912398
smart_str_appendl(&array_type,"xsd:ur-type",sizeof("xsd:ur-type")-1);
23922399
}

0 commit comments

Comments
 (0)