enable use of PHP 8.2

This commit is contained in:
El RIDO 2022-10-25 06:53:26 +02:00
parent 27965d0287
commit b890d768d1
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92

View File

@ -12,23 +12,23 @@ jobs:
run: composer validate run: composer validate
- name: Install dependencies - name: Install dependencies
run: composer install --prefer-dist --no-dev run: composer install --prefer-dist --no-dev
PHPunit: PHPunit:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
php-versions: ['7.3', '7.4', '8.0', '8.1'] php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']
name: PHP ${{ matrix.php-versions }} unit tests on ${{ matrix.operating-system }} name: PHP ${{ matrix.php-versions }} unit tests on ${{ matrix.operating-system }}
env: env:
extensions: gd, sqlite3 extensions: gd, sqlite3
extensions-cache-key-name: phpextensions extensions-cache-key-name: phpextensions
steps: steps:
# let's get started! # let's get started!
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
# cache PHP extensions # cache PHP extensions
- name: Setup cache environment - name: Setup cache environment
id: extcache id: extcache
@ -44,29 +44,29 @@ jobs:
path: ${{ steps.extcache.outputs.dir }} path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }} key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ runner.os }}-${{ env.extensions-cache-key }} restore-keys: ${{ runner.os }}-${{ env.extensions-cache-key }}
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: ${{ matrix.php-versions }} php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }} extensions: ${{ env.extensions }}
# Setup GitHub CI PHP problem matchers # Setup GitHub CI PHP problem matchers
# https://github.com/shivammathur/setup-php#problem-matchers # https://github.com/shivammathur/setup-php#problem-matchers
- name: Setup problem matchers for PHP - name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup problem matchers for PHPUnit - name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
# composer cache # composer cache
- name: Remove composer lock - name: Remove composer lock
run: rm composer.lock run: rm composer.lock
- name: Get composer cache directory - name: Get composer cache directory
id: composer-cache id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)" run: echo "::set-output name=dir::$(composer config cache-files-dir)"
# http://man7.org/linux/man-pages/man1/date.1.html # http://man7.org/linux/man-pages/man1/date.1.html
# https://github.com/actions/cache#creating-a-cache-key # https://github.com/actions/cache#creating-a-cache-key
- name: Get Date - name: Get Date
@ -74,48 +74,47 @@ jobs:
run: | run: |
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")" echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
shell: bash shell: bash
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: ${{ steps.composer-cache.outputs.dir }} path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/composer.json') }} key: ${{ runner.os }}-composer-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-${{ steps.get-date.outputs.date }}- restore-keys: ${{ runner.os }}-composer-${{ steps.get-date.outputs.date }}-
# composer installation # composer installation
- name: Setup PHPunit - name: Setup PHPunit
run: composer install -n run: composer install -n
- name: Install Google Cloud Storage - name: Install Google Cloud Storage
run: composer require google/cloud-storage run: composer require google/cloud-storage
# testing # testing
- name: Run unit tests - name: Run unit tests
run: ../vendor/bin/phpunit --no-coverage run: ../vendor/bin/phpunit --no-coverage
working-directory: tst working-directory: tst
Mocha: Mocha:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: '16' node-version: '16'
cache: 'npm' cache: 'npm'
cache-dependency-path: 'js/package-lock.json' cache-dependency-path: 'js/package-lock.json'
- name: Setup Mocha - name: Setup Mocha
run: npm install -g mocha run: npm install -g mocha
- name: Setup Node modules - name: Setup Node modules
run: npm ci run: npm ci
working-directory: js working-directory: js
- name: Run unit tests - name: Run unit tests
run: npm test run: npm test
working-directory: js working-directory: js