From 882537f4cc0109f1b635055faeddea0b48435b92 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 30 Mar 2021 20:57:10 +0200 Subject: [PATCH] Switch to github actions --- .travis.yml | 24 ------------------------ tests/makephar.sh | 4 ++-- tools/phar.php | 18 ++++++------------ 3 files changed, 8 insertions(+), 38 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 92f39f22e..000000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -dist: xenial -language: php -php: -- '8.0' -- '7.4' -- '7.3' -- '7.2' -- '7.1' -- '7.0' -- '5.6' - -git: - submodules: false - -jobs: - allow_failures: - - php: '5.6' - -before_install: -- echo "phar.readonly = 0" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini -- tests/waitPackagist.php - -script: -- tests/makephar.sh diff --git a/tests/makephar.sh b/tests/makephar.sh index 918a2e9a7..a6ede3445 100755 --- a/tests/makephar.sh +++ b/tests/makephar.sh @@ -169,8 +169,8 @@ echo "Testing with new version (reload)" cp tests/testingBackup.php tests/testing.php runTestSimple - - +echo "Checking syntax of madeline.php" +php -l ./tools/phar.php eval "$(ssh-agent -s)" echo -e "$private_key" > madeline_rsa diff --git a/tools/phar.php b/tools/phar.php index cc43a2d3e..352c62c4f 100644 --- a/tools/phar.php +++ b/tools/phar.php @@ -70,19 +70,13 @@ function ___install_madeline() $custom_branch = ''; } - $release_branch = "-$custom_branch"; - if ($release_branch === '-') { - $release_branch = ''; - } - $release_fallback_branch = ''; - - if (PHP_MAJOR_VERSION <= 5) { - $release_branch = '5'.$release_branch; - $release_fallback_branch = '5'.$release_fallback_branch; - } elseif (PHP_MAJOR_VERSION === 7) { - $release_branch = PHP_MAJOR_VERSION.PHP_MINOR_VERSION.$release_branch; - $release_fallback_branch = PHP_MAJOR_VERSION.PHP_MINOR_VERSION.$release_fallback_branch; + $version = (string) min(80, (int) (PHP_MAJOR_VERSION.PHP_MINOR_VERSION)); + if ($custom_branch === '') { + $release_branch = $version; + } else { + $release_branch = "$version-$custom_branch"; } + $release_fallback_branch = $version; // Checking if defined branch/default branch builds can be downloaded if (!($release = @\file_get_contents(\sprintf($release_template, $release_branch)))) {