call curl_close after last use of the curl object #968
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # GitHub Action for CodeIgniter | |
| name: Testing Kalkun | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - devel | |
| - 'release-**' | |
| - 'feature-**' | |
| pull_request: | |
| branches: [ master, devel ] | |
| jobs: | |
| required_php_versions: | |
| name: Get PHP versions to test | |
| runs-on: ubuntu-latest | |
| outputs: | |
| php_versions: ${{ steps.php_ver_step.outputs.PHP_VERSIONS }} | |
| php_versions_matrix: ${{ steps.php_ver_step.outputs.PHP_VERSIONS_matrix }} | |
| steps: | |
| - name: Install required packages | |
| run: | | |
| if ! command -v jq; then sudo apt-get update && sudo apt-get install -y jq; fi | |
| - name: Build PHP_VERSIONS array & PHP_VERSIONS_matrix | |
| id: php_ver_step | |
| run: | | |
| set -x | |
| # Set array that will store the PHP versions for which we create a package. | |
| PHP_VERSIONS=() | |
| # Get all released php versions above 5.6 (in the format X.Y) | |
| for upstream_ver in $(curl https://www.php.net/releases/?json | jq -r '.[].version' | cut -f -2 -d .); do | |
| major=$(cut -f 1 -d . <<< "$upstream_ver") | |
| for minor in {0..20}; do | |
| if dpkg --compare-versions ${major}.$minor le $upstream_ver && dpkg --compare-versions ${major}.$minor ge 5.6; then | |
| PHP_VERSIONS+=("${major}.$minor") | |
| fi | |
| done | |
| done | |
| PHP_VERSIONS_matrix=$(sed 's/\ /", "/g' <<< [\"${PHP_VERSIONS[*]}\"]) | |
| echo "PHP_VERSIONS=${PHP_VERSIONS[*]}" >> "$GITHUB_OUTPUT" | |
| echo "PHP_VERSIONS_matrix=$PHP_VERSIONS_matrix" >> "$GITHUB_OUTPUT" | |
| echo "PHP_VERSIONS=${PHP_VERSIONS[*]}" | |
| echo "PHP_VERSIONS_matrix=$PHP_VERSIONS_matrix" | |
| test: | |
| continue-on-error: false | |
| needs: [ required_php_versions ] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| operating-system: [ubuntu-latest] | |
| #php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] | |
| php-versions: ${{fromJson(needs.required_php_versions.outputs.php_versions_matrix)}} | |
| runs-on: ${{ matrix.operating-system }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP, with composer and extensions | |
| uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: ctype, curl, hash, intl, json, mbstring, session | |
| coverage: xdebug #optional | |
| - name: Get composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| # Use composer.json for key, if composer.lock is not committed. | |
| # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock', 'composer-phpunit.lock', 'composer-test_deps.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install composer dependencies | |
| run: | | |
| composer update | |
| composer install --no-progress --prefer-dist --optimize-autoloader | |
| COMPOSER=composer-phpunit.json composer update | |
| COMPOSER=composer-phpunit.json composer install --no-progress --prefer-dist --optimize-autoloader | |
| COMPOSER=composer-test_deps.json composer update | |
| COMPOSER=composer-test_deps.json composer install --no-progress --prefer-dist --optimize-autoloader | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get -y install libdbd-sqlite3 gammu-smsd | |
| - name: Start MySQL & PostgreSQL + create DB users | |
| run: ./utils/db_create_user.sh | |
| - name: Check availability of java, otherwise install it | |
| run: | | |
| set -x | |
| /usr/bin/java -version || true | |
| java -version || true | |
| ${JAVA_HOME}/bin/java -version || true | |
| ${JAVA_HOME_17_X64}/bin/java -version || true | |
| java -version || sudo apt-get -y install default-jre | |
| - uses: robinraju/release-downloader@v1 | |
| with: | |
| repository: 'validator/validator' | |
| latest: false | |
| tag: '20.6.30' | |
| fileName: 'vnu.jar_20.6.30.zip' | |
| tarBall: false | |
| zipBall: false | |
| out-file-path: '../vnu' | |
| extract: true | |
| - name: Install tidy, v.Nu (Nu Html Checker) | |
| run: | | |
| sudo apt-get -y install tidy | |
| find ../vnu -name vnu.jar -exec mv '{}' utils \; | |
| ./utils/start_vnu_http_server.sh | |
| - name: Install/Update ci-phpunit-test | |
| run: ./utils/prepare_tests_for_phpunit.sh | |
| - name: Test with phpunit | |
| run: HTML=5 vendor-phpunit/bin/phpunit --coverage-text -c tests | |
| check-code: | |
| strategy: | |
| matrix: | |
| operating-system: [ubuntu-latest] | |
| php-versions: ['8.2'] | |
| runs-on: ${{ matrix.operating-system }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP, with composer and extensions | |
| uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: mbstring, intl, curl, dom | |
| coverage: xdebug #optional | |
| - name: Get composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| # Use composer.json for key, if composer.lock is not committed. | |
| # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install dependencies | |
| run: | | |
| composer update --working-dir=utils | |
| composer install --working-dir=utils --no-progress --prefer-dist --optimize-autoloader | |
| sudo apt-get update | |
| # html-beautify from the debian package doesn't work for some reason | |
| # sudo apt-get install -y node-js-beautify | |
| # Install npm and install js-beautify from there | |
| sudo apt-get install -y npm | |
| sudo npm update --verbose -g npm | |
| sudo npm install --verbose -g js-beautify | |
| - id: check_strict_comparison | |
| name: Check that strict comparison operators are used everywhere | |
| run: | | |
| #git checkout utils/composer.lock | |
| git status | |
| utils/fix_code_style.sh strict | |
| - id: check_style | |
| name: Check that code follows Guidelines | |
| if: always() | |
| run: | | |
| #git checkout utils/composer.lock | |
| git status | |
| utils/fix_code_style.sh git-diff | |
| - name: Archive artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Code style issues to fix | |
| path: 'code_style_check*' | |
| if-no-files-found: ignore | |
| check-translation: | |
| strategy: | |
| matrix: | |
| operating-system: [ubuntu-latest] | |
| php-versions: ['7.2'] | |
| runs-on: ${{ matrix.operating-system }} | |
| continue-on-error: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP, with composer and extensions | |
| uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: mbstring, intl, curl, dom | |
| coverage: xdebug #optional | |
| - name: Get composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| # Use composer.json for key, if composer.lock is not committed. | |
| # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install dependencies | |
| run: | | |
| composer update --working-dir=utils | |
| composer install --working-dir=utils --no-progress --prefer-dist --optimize-autoloader | |
| - id: translation | |
| name: Check translations | |
| run: | | |
| mkfifo pipe | |
| tee translation_check_output.txt < pipe & | |
| ./utils/check_translation.php all > pipe | |
| - name: Archive artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Translation check output | |
| path: 'translation_check_output.*' | |
| if-no-files-found: ignore |