test-ci.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. name: PHP CI with Composer
  2. on:
  3. push:
  4. paths-ignore:
  5. - '**.md'
  6. jobs:
  7. build:
  8. strategy:
  9. fail-fast: false
  10. max-parallel: 1
  11. matrix:
  12. php-versions: ['5.4', '5.5', '5.6', '7.0']
  13. runs-on: ubuntu-latest
  14. steps:
  15. - name: Checkout
  16. uses: actions/checkout@v2
  17. - name: Setup php
  18. uses: shivammathur/setup-php@v2
  19. with:
  20. php-version: ${{ matrix.php-versions }}
  21. - name: Install dependencies
  22. run: |
  23. composer self-update
  24. composer install --no-interaction --prefer-source --dev
  25. - name: Run cases
  26. run: |
  27. nohup php -S localhost:9000 -t ./tests/mock-server/ > phpd.log 2>&1 &
  28. export PHP_SERVER_PID=$!
  29. ./vendor/bin/phpcs --standard=PSR2 src
  30. ./vendor/bin/phpcs --standard=PSR2 examples
  31. ./vendor/bin/phpcs --standard=PSR2 tests
  32. ./vendor/bin/phpunit --coverage-clover=coverage.xml
  33. kill $PHP_SERVER_PID
  34. env:
  35. QINIU_ACCESS_KEY: ${{ secrets.QINIU_ACCESS_KEY }}
  36. QINIU_SECRET_KEY: ${{ secrets.QINIU_SECRET_KEY }}
  37. QINIU_TEST_BUCKET: ${{ secrets.QINIU_TEST_BUCKET }}
  38. QINIU_TEST_DOMAIN: ${{ secrets.QINIU_TEST_DOMAIN }}
  39. - name: After_success
  40. run: bash <(curl -s https://codecov.io/bash)