Skip to content

feat: Compatible with thinkphp8.0 #43

feat: Compatible with thinkphp8.0

feat: Compatible with thinkphp8.0 #43

Workflow file for this run

name: Default
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: tauthz
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: true
matrix:
include:
# ThinkPHP 6.*
- php: 7.1
thinkphp: 6.*
- php: 7.2
thinkphp: 6.*
- php: 7.4
thinkphp: 6.*
- php: 8.0
thinkphp: 6.*
- php: 8.1
thinkphp: 6.*
# ThinkPHP 8.*
- php: 8.0
thinkphp: 8.*
- php: 8.1
thinkphp: 8.*
name: ThinkPHP${{ matrix.thinkphp }}-PHP${{ matrix.php }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: xdebug
- name: Pre composer
if: ${{ jobs.test.strategy.matrix.thinkphp }} == '8.*'

Check failure on line 55 in .github/workflows/default.yml

View workflow run for this annotation

GitHub Actions / Default

Invalid workflow file

The workflow is not valid. .github/workflows/default.yml (Line: 55, Col: 13): Unrecognized named-value: 'jobs'. Located at position 1 within expression: jobs.test.strategy.matrix.thinkphp .github/workflows/default.yml (Line: 81, Col: 13): Unrecognized named-value: 'jobs'. Located at position 1 within expression: jobs.test.strategy.matrix.thinkphp
run: composer remove-dev php-coveralls/php-coveralls
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.thinkphp }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-${{ matrix.thinkphp }}
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer require topthink/framework:${{ matrix.thinkphp }} --no-update --no-interaction
composer require topthink/think:${{ matrix.thinkphp }} --no-update --no-interaction --dev
composer install --prefer-dist --no-progress --no-suggest
- name: Run test suite
run: ./vendor/bin/phpunit
- name: Run Coveralls
if: ${{ jobs.test.strategy.matrix.thinkphp }} != '8.*'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: ${{ runner.os }} - ${{ matrix.php }}
run: |
composer global require php-coveralls/php-coveralls:^2.4
php-coveralls --coverage_clover=build/logs/clover.xml -v
upload-coverage:
runs-on: ubuntu-latest
needs: [ test ]
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
semantic-release:
runs-on: ubuntu-latest
needs: [ test ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release