1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-23 03:31:17 +01:00
This commit is contained in:
Daniil Gentili 2023-11-30 19:30:29 +01:00
parent d0c2cb500d
commit c41047c55c
3 changed files with 34 additions and 19 deletions

17
tests/lock_setup.php Normal file
View File

@ -0,0 +1,17 @@
<?php
$lock = fopen('/tmp/woodpecker.lock', 'c+');
flock($lock, LOCK_EX);
if (fread($lock, 1) !== "1") {
exec("tests/setup.sh", $o, $res);
fwrite($lock, "1");
} else {
$o = [];
$res = 0;
}
flock($lock, LOCK_UN);
echo implode("\n", $o);
exit($res);

16
tests/setup.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
set -ex
export COMPOSER_PROCESS_TIMEOUT=100000
apk add procps git unzip github-cli openssh
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer
php tests/jit.php
composer update

View File

@ -4,25 +4,7 @@ set -ex
export COMPOSER_PROCESS_TIMEOUT=100000
(
flock -x 200 || exit 1
touch /tmp/ci_status
if [ "$(cat /tmp/ci_status)" != "done" ]; then
apk add procps git unzip github-cli openssh
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer
php tests/jit.php
composer update
echo done > /tmp/ci_status
fi
) 200>/var/lock/woodpecker.lock
php tests/lock_setup.php
if [ "$1" == "cs" ]; then
composer psalm