Skip to content

Commit 3993cdb

Browse files
committed
Run tests on 32-bit PHP
1 parent c0e7bc9 commit 3993cdb

1 file changed

Lines changed: 13 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ jobs:
107107
phpunit-32bit:
108108
name: PHPUnit (32-bit)
109109
runs-on: ubuntu-latest
110-
container:
111-
image: php:8.5-cli
112-
options: --platform linux/386
113110

114111
strategy:
115112
fail-fast: false
@@ -123,21 +120,17 @@ jobs:
123120
- name: Checkout
124121
uses: actions/checkout@v4
125122

126-
- name: Install dependencies
127-
run: |
128-
apt-get update
129-
apt-get install -y libgmp-dev unzip
130-
docker-php-ext-install gmp bcmath > /dev/null
131-
132-
- name: Install composer dependencies
133-
uses: ramsey/composer-install@v3
134-
135-
- name: Ensure 32-bit
136-
run: |
137-
php -r 'echo "PHP_INT_SIZE=", PHP_INT_SIZE, "\n";'
138-
php -r 'exit(PHP_INT_SIZE === 4 ? 0 : 1);'
139-
140123
- name: Run PHPUnit
141-
run: vendor/bin/phpunit
142-
env:
143-
CALCULATOR: ${{ matrix.calculator }}
124+
run: |
125+
docker run --platform linux/386 --rm \
126+
-v ${{ github.workspace }}:/app \
127+
-w /app \
128+
-e CALCULATOR=${{ matrix.calculator }} \
129+
php:8.5-cli bash -c "\
130+
apt-get update && \
131+
apt-get install -y libgmp-dev unzip && \
132+
docker-php-ext-install gmp bcmath > /dev/null && \
133+
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
134+
composer install --no-interaction && \
135+
php -r 'echo \"PHP_INT_SIZE=\", PHP_INT_SIZE, \"\n\"; exit(PHP_INT_SIZE === 4 ? 0 : 1);' && \
136+
vendor/bin/phpunit"

0 commit comments

Comments
 (0)