6 types: [opened, synchronize, reopened]
16 name: Test on PHP ${{ matrix.php-version }} (${{ matrix.arch }})
17 runs-on: ubuntu-latest
18 continue-on-error: ${{ matrix.experimental }}
23 - { php-version: '82', experimental: false, arch: 'amd64', exclude-phpunit-groups: 'extension-iconv' }
24 - { php-version: '82', experimental: false, arch: 'arm64v8', exclude-phpunit-groups: 'extension-iconv' }
25 - { php-version: '82', experimental: false, arch: 'arm32v7', exclude-phpunit-groups: 'extension-iconv,32bit-incompatible' }
26 - { php-version: '82', experimental: false, arch: 'i386', exclude-phpunit-groups: 'extension-iconv,32bit-incompatible' }
27 - { php-version: '82', experimental: true, arch: 'ppc64le', exclude-phpunit-groups: 'extension-iconv' }
28 - { php-version: '82', experimental: false, arch: 's390x', exclude-phpunit-groups: 'extension-iconv,32bit-incompatible' }
31 uses: actions/checkout@v4
34 # tcpdf allowed memory exhausted needs the memory_limit workaround
35 # musl-locales and musl-locales-lang are needed to run some locale specific tests
36 # gettext is needed to run generate-mo
37 # git is needed to work around a version detection issue with composer, see: https://github.com/Roave/SecurityAdvisories/issues/76
42 apk add --update --no-cache \
43 php\$V-cli php\$V-mysqli php\$V-session php\$V-mbstring php\$V-ctype php\$V-sodium \
44 php\$V-iconv php\$V-xml php\$V-tokenizer php\$V-xmlwriter php\$V-simplexml \
45 php\$V-dom php\$V-json php\$V-bz2 php\$V-curl php\$V-gd php\$V-zip php\$V-bcmath \
46 musl-locales musl-locales-lang \
47 gettext composer git && \
48 composer config version "$(php -r "define('VERSION_SUFFIX', ''); require_once('src/Version.php'); echo \PhpMyAdmin\Version::VERSION;")" && \
50 ./bin/generate-mo && \
51 php\$V -d memory_limit=512M ./vendor/bin/phpunit --no-logging --no-coverage --testsuite unit --exclude-group=%s" \
52 "${{ matrix.php-version }}" "${{ matrix.exclude-phpunit-groups }}" > ./do-tests.sh
54 - name: Set up multi arch support
55 run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
58 run: docker run --rm ${{ matrix.arch }}/alpine:3.19 uname -a
60 - name: Run tests on php ${{ matrix.php-version }}
61 run: docker run -v $PWD:/app --workdir /app --rm ${{ matrix.arch }}/alpine:3.19 sh /app/do-tests.sh
64 name: Test on PHP ${{ matrix.php-version }}, ${{ matrix.composer-dependency }} and ${{ matrix.os }}
65 runs-on: ${{ matrix.os }}
66 continue-on-error: ${{ matrix.php-version == '8.4' }}
69 php-version: ['8.2', '8.3']
71 composer-dependency: [locked, highest]
72 php-extensions: ['mbstring, iconv, mysqli, zip, gd, bz2']
76 composer-dependency: locked
77 composer-options: '--ignore-platform-req=php+'
78 php-extensions: 'mbstring, iconv, mysqli, zip, bz2'
81 uses: actions/checkout@v4
83 # Fetch some commits for Scrutinizer coverage upload
86 - name: Install gettext
87 run: sudo apt-get install -y gettext
89 - name: Generate mo files
90 run: ./bin/generate-mo --quiet
92 - name: Set up PHP ${{ matrix.php-version }}
93 uses: shivammathur/setup-php@v2
95 php-version: ${{ matrix.php-version }}
96 extensions: ${{ matrix.php-extensions }}
99 - name: Install Composer dependencies
100 uses: ramsey/composer-install@v3
102 dependency-versions: ${{ matrix.composer-dependency }}
103 composer-options: ${{ matrix.composer-options }}
105 - name: Run PHP tests
106 run: composer run phpunit -- --testsuite unit --display-deprecations --display-notices --display-warnings --display-errors
108 - name: Send coverage
109 uses: codecov/codecov-action@v3
111 flags: unit-${{ matrix.php-version }}-${{ matrix.os }}
112 name: phpunit-${{ matrix.php-version }}-${{ matrix.os }}
114 - name: Send coverage to Scrutinizer
115 uses: sudo-bot/action-scrutinizer@latest
116 # Do not run this step on forked versions of the main repository (example: contributor forks)
117 if: github.repository == 'phpmyadmin/phpmyadmin'
119 cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
121 - name: Send coverage to Codacy
122 uses: codacy/codacy-coverage-reporter-action@v1
123 # Do not run this step on forked versions of the main repository (example: contributor forks)
124 if: github.repository == 'phpmyadmin/phpmyadmin'
125 # Upload can fail on forks or if the secret is missing
126 continue-on-error: true
128 project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
129 coverage-reports: build/logs/clover.xml
131 test-php-optional-extensions:
132 name: Test on PHP (+ ext-${{ matrix.extension }}) ${{ matrix.php-version }} and ${{ matrix.os }}
133 runs-on: ${{ matrix.os }}
140 - name: Checkout code
141 uses: actions/checkout@v4
143 # Fetch some commits for Scrutinizer coverage upload
146 - name: Install gettext
147 run: sudo apt-get install -y gettext
149 - name: Generate mo files
150 run: ./bin/generate-mo --quiet
152 - name: Set up PHP ${{ matrix.php-version }}
153 uses: shivammathur/setup-php@v2
155 php-version: ${{ matrix.php-version }}
156 extensions: ${{ matrix.extension }}, mbstring, iconv, mysqli, zip, gd
159 - name: Install Composer dependencies
160 uses: ramsey/composer-install@v3
162 - name: Run PHP tests
163 run: composer run phpunit -- --testsuite unit
165 - name: Send coverage
166 uses: codecov/codecov-action@v3
168 flags: ${{ matrix.extension }}-extension
169 name: php-${{ matrix.php-version }}-${{ matrix.extension }}-enabled
171 - name: Send coverage to Scrutinizer
172 uses: sudo-bot/action-scrutinizer@latest
173 # Do not run this step on forked versions of the main repository (example: contributor forks)
174 if: github.repository == 'phpmyadmin/phpmyadmin'
176 cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
178 - name: Send coverage to Codacy
179 uses: codacy/codacy-coverage-reporter-action@v1
180 # Do not run this step on forked versions of the main repository (example: contributor forks)
181 if: github.repository == 'phpmyadmin/phpmyadmin'
182 # Upload can fail on forks or if the secret is missing
183 continue-on-error: true
185 project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
186 coverage-reports: build/logs/clover.xml