|
| 1 | +name: test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '*' |
| 7 | + pull_request: |
| 8 | + types: |
| 9 | + - opened |
| 10 | + - synchronize |
| 11 | + - reopened |
| 12 | + branches: |
| 13 | + - 'master' |
| 14 | + |
| 15 | +jobs: |
| 16 | + test_unit: |
| 17 | + name: Unit Tests |
| 18 | + runs-on: ubuntu-latest |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + include: |
| 22 | + - php: '7.1' |
| 23 | + symfony: '3.4.*' |
| 24 | + - php: '7.4' |
| 25 | + symfony: '3.4.*' |
| 26 | + - php: '7.2' |
| 27 | + symfony: '4.4.*' |
| 28 | + - php: '7.4' |
| 29 | + symfony: '4.4.*' |
| 30 | + - php: '7.2' |
| 31 | + symfony: '5.1.*' |
| 32 | + - php: '7.4' |
| 33 | + symfony: '5.1.*' |
| 34 | + steps: |
| 35 | + - name: checkout |
| 36 | + uses: actions/checkout@v2 |
| 37 | + - name: setup php |
| 38 | + |
| 39 | + with: |
| 40 | + php-version: ${{ matrix.php }} |
| 41 | + - name: prepare test environment |
| 42 | + run: | |
| 43 | + Tests/Functional/Scripts/downloadComposer.sh |
| 44 | + composer config extra.symfony.require "${{ matrix.symfony }}" |
| 45 | + composer config extra.symfony.allow-contrib true |
| 46 | + # adds flex, suppress composer.lock |
| 47 | + composer require symfony/flex --no-update |
| 48 | + # create a lock file |
| 49 | + composer install |
| 50 | + # updates to SYMFONY_VERSION, but runs recipes |
| 51 | + composer update symfony/* |
| 52 | + # reset tracked files |
| 53 | + git reset --hard |
| 54 | + # clean up recipe generated files and folders |
| 55 | + git clean -df |
| 56 | + - name: execute unit tests |
| 57 | + run: composer run-script quality |
| 58 | + - name: upload coverage |
| 59 | + env: |
| 60 | + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + run: php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v |
| 62 | + |
| 63 | + test_functional: |
| 64 | + name: Functional Tests |
| 65 | + needs: |
| 66 | + - test_unit |
| 67 | + runs-on: ubuntu-latest |
| 68 | + strategy: |
| 69 | + matrix: |
| 70 | + symfony: |
| 71 | + - '3.4.*' |
| 72 | + - '4.4.*' |
| 73 | + - '5.1.*' |
| 74 | + steps: |
| 75 | + - name: checkout |
| 76 | + uses: actions/checkout@v2 |
| 77 | + - name: setup php |
| 78 | + |
| 79 | + with: |
| 80 | + php-version: '7.4' |
| 81 | + - name: prepare test environment |
| 82 | + run: | |
| 83 | + Tests/Functional/Scripts/downloadComposer.sh |
| 84 | + composer config extra.symfony.require "${{ matrix.symfony }}" |
| 85 | + composer config extra.symfony.allow-contrib true |
| 86 | + # adds flex, suppress composer.lock |
| 87 | + composer require symfony/flex --no-update |
| 88 | + # create a lock file |
| 89 | + composer install |
| 90 | + # updates to SYMFONY_VERSION, but runs recipes |
| 91 | + composer update symfony/* |
| 92 | + # reset tracked files |
| 93 | + git reset --hard |
| 94 | + # clean up recipe generated files and folders |
| 95 | + git clean -df |
| 96 | + - name: install symfony cli |
| 97 | + run: | |
| 98 | + wget https://get.symfony.com/cli/installer -O - | bash |
| 99 | + sudo mv ~/.symfony/bin/symfony /usr/local/bin/symfony |
| 100 | + - name: execute functional tests |
| 101 | + env: |
| 102 | + SYMFONY_VERSION: ${{ matrix.symfony }} |
| 103 | + run: composer run-script phpunit-functional |
| 104 | + - name: show running containers |
| 105 | + run: docker ps |
0 commit comments