Skip to content

Commit cf5572c

Browse files
committed
Fixed failing tests in Github CI for Ubuntu 22.04
1 parent ec4c781 commit cf5572c

File tree

4 files changed

+776
-413
lines changed

4 files changed

+776
-413
lines changed

.github/act/Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM ubuntu-latest
2+
3+
# Install necessary dependencies
4+
RUN apt-get update && apt-get install -y \
5+
sudo \
6+
git \
7+
curl \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
# Get correct version of nodejs
11+
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - \
12+
&& sudo apt install -y nodejs
13+
14+
# Create a non-root user (same as GitHub Actions)
15+
RUN useradd -m runner && \
16+
echo "runner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
17+
18+
# Set user to 'runner'
19+
USER runner
20+
21+
# Set working directory (GitHub Actions uses this location)
22+
WORKDIR /home/runner
23+
24+
CMD ["/bin/bash"]

.github/workflows/ci.yml

+26-15
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,26 @@ name: Shaarli CI
22
on: [push, pull_request]
33
jobs:
44
php:
5-
runs-on: ubuntu-latest
5+
runs-on: ubuntu-22.04
66
strategy:
77
fail-fast: false
88
matrix:
99
php-versions: ['7.4', '8.0', '8.1', '8.2']
1010
name: PHP ${{ matrix.php-versions }}
1111
steps:
12-
- name: Set locales
13-
run: |
14-
sudo locale-gen de_DE.utf8 && \
15-
sudo locale-gen en_US.utf8 && \
16-
sudo locale-gen fr_FR.utf8 && \
17-
sudo dpkg-reconfigure --frontend=noninteractive locales
18-
19-
- name: Install Gettext
20-
run: sudo apt-get install gettext
21-
2212
- name: Checkout
2313
uses: actions/checkout@v4
2414

15+
- name: Install Gettext
16+
run: |
17+
sudo apt-get update && \
18+
sudo apt-get install -y gettext
19+
2520
- name: Setup PHP
2621
uses: shivammathur/setup-php@v2
2722
with:
2823
php-version: ${{ matrix.php-versions }}
29-
extensions: gd, xml, curl, mbstring, intl, gettext
24+
extensions: gd, xml, curl, mbstring, intl, gettext, ldap
3025
tools: composer:v2
3126

3227
- name: Check PHP version
@@ -36,16 +31,32 @@ jobs:
3631
run: composer config --unset platform && composer config platform.php ${{ matrix.php-versions }}
3732

3833
- name: Update dependencies for PHP 8.x
39-
if: ${{ matrix.php-versions == '8.0' || matrix.php-versions == '8.1' }}
34+
if: ${{ matrix.php-versions != '7.4' }}
4035
run: |
4136
composer update && \
4237
composer remove --dev phpunit/phpunit && \
4338
composer require --dev phpunit/php-text-template ^2.0 && \
4439
composer require --dev phpunit/phpunit ^9.0
4540
4641
- name: Update dependencies for PHP 7.x
47-
if: ${{ matrix.php-versions != '8.0' && matrix.php-versions != '8.1' }}
48-
run: composer update
42+
if: ${{ matrix.php-versions == '7.4' }}
43+
run: |
44+
composer update && \
45+
echo php -v
46+
47+
- name: Install locales
48+
run: |
49+
sudo apt-get update && \
50+
sudo apt-get install -y locales
51+
52+
- name: Set locales
53+
run: |
54+
sudo locale-gen de_DE.utf8 && \
55+
sudo locale-gen en_US.utf8 && \
56+
sudo locale-gen fr_FR.utf8
57+
58+
- name: Check locales
59+
run: locale -a
4960

5061
- name: Clean up
5162
run: make clean

composer.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"config": {
1313
"sort-packages": true,
1414
"platform": {
15-
"php": "7.4.33"
15+
"php": "8.2"
1616
}
1717
},
1818
"require": {
@@ -30,9 +30,10 @@
3030
"slim/slim": "^3.0"
3131
},
3232
"require-dev": {
33+
"phpunit/php-text-template": "^2.0",
34+
"phpunit/phpunit": "^9.0",
3335
"roave/security-advisories": "dev-master",
34-
"squizlabs/php_codesniffer": "^3.0",
35-
"phpunit/phpunit": "^9.0"
36+
"squizlabs/php_codesniffer": "^3.0"
3637
},
3738
"suggest": {
3839
"ext-curl": "Allows fetching web pages and thumbnails in a more robust way",

0 commit comments

Comments
 (0)