tests.yaml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. name: PHP Tests
  2. on:
  3. push:
  4. branches: [ develop ]
  5. pull_request:
  6. branches: [ develop ]
  7. jobs:
  8. unit-tests:
  9. runs-on: ${{ matrix.os }}
  10. strategy:
  11. matrix:
  12. php: [ 8.0, 7.4, 7.3]
  13. os: [ubuntu-latest]
  14. steps:
  15. - uses: actions/checkout@v2
  16. - name: Setup PHP
  17. uses: shivammathur/setup-php@v2
  18. with:
  19. php-version: ${{ matrix.php }}
  20. extensions: opcache, gd
  21. coverage: none
  22. env:
  23. COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  24. # - name: Update composer
  25. # run: composer update
  26. #
  27. # - name: Validate composer.json and composer.lock
  28. # run: composer validate
  29. - name: Get composer cache directory
  30. id: composer-cache
  31. run: echo "::set-output name=dir::$(composer config cache-files-dir)"
  32. - name: Cache dependencies
  33. uses: actions/cache@v2
  34. with:
  35. path: ${{ steps.composer-cache.outputs.dir }}
  36. key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
  37. restore-keys: ${{ runner.os }}-composer-
  38. - name: Install dependencies
  39. run: composer install --prefer-dist --no-progress
  40. - name: Run test suite
  41. run: vendor/bin/codecept run
  42. # slack:
  43. # name: Slack
  44. # needs: unit-tests
  45. # runs-on: ubuntu-latest
  46. # if: always()
  47. # steps:
  48. # - uses: technote-space/workflow-conclusion-action@v2
  49. # - uses: 8398a7/action-slack@v3
  50. # with:
  51. # status: failure
  52. # fields: repo,message,author,action
  53. # icon_emoji: ':octocat:'
  54. # author_name: 'Github Action Tests'
  55. # text: '💥 Automated Test Failure'
  56. # env:
  57. # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  58. # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  59. # if: env.WORKFLOW_CONCLUSION == 'failure'