main.yml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. name: CI
  2. on: [push, pull_request]
  3. jobs:
  4. tests:
  5. runs-on: ubuntu-latest
  6. strategy:
  7. matrix:
  8. php: [7.3, 7.4, 8.0]
  9. symfony: [4.4, 5.2]
  10. steps:
  11. - name: Checkout code
  12. uses: actions/checkout@v2
  13. - name: Setup PHP
  14. uses: shivammathur/setup-php@v2
  15. with:
  16. php-version: ${{ matrix.php }}
  17. tools: composer:v2
  18. extensions: ctype, iconv, intl, json, mbstring, pdo, pdo_sqlite
  19. coverage: none
  20. - name: Checkout Symfony 4.4 Sample
  21. if: matrix.symfony == 4.4
  22. uses: actions/checkout@v2
  23. with:
  24. repository: Codeception/symfony-module-tests
  25. path: framework-tests
  26. ref: 4.4
  27. - name: Checkout Symfony 5.2 Sample
  28. if: matrix.symfony == 5.2
  29. uses: actions/checkout@v2
  30. with:
  31. repository: Codeception/symfony-module-tests
  32. path: framework-tests
  33. ref: main
  34. - name: Get composer cache directory
  35. id: composer-cache
  36. run: echo "::set-output name=dir::$(composer config cache-files-dir)"
  37. - name: Cache composer dependencies
  38. uses: actions/cache@v2.1.3
  39. with:
  40. path: ${{ steps.composer-cache.outputs.dir }}
  41. key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
  42. restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
  43. - name: Install dependencies
  44. run: |
  45. composer require symfony/finder=${{ matrix.symfony }} --ignore-platform-req=php --no-update
  46. composer require symfony/yaml=${{ matrix.symfony }} --ignore-platform-req=php --no-update
  47. composer require symfony/console=${{ matrix.symfony }} --ignore-platform-req=php --no-update
  48. composer require symfony/event-dispatcher=${{ matrix.symfony }} --ignore-platform-req=php --no-update
  49. composer require symfony/css-selector=${{ matrix.symfony }} --ignore-platform-req=php --no-update
  50. composer require symfony/dom-crawler=${{ matrix.symfony }} --ignore-platform-req=php --no-update
  51. composer require symfony/browser-kit=${{ matrix.symfony }} --ignore-platform-req=php --no-update
  52. composer install --prefer-dist --no-progress --ignore-platform-req=php
  53. - name: Validate composer.json and composer.lock
  54. run: composer validate
  55. working-directory: framework-tests
  56. - name: Install Symfony Sample
  57. run: |
  58. composer remove codeception/module-symfony --dev --no-update
  59. composer update --no-progress
  60. working-directory: framework-tests
  61. - name: Prepare the test environment
  62. run: |
  63. php bin/console d:s:u -f
  64. php bin/console d:f:l -q
  65. working-directory: framework-tests
  66. - name: Run test suite
  67. run: |
  68. php vendor/bin/codecept build -c framework-tests
  69. php vendor/bin/codecept run Functional -c framework-tests