|
| 1 | +name: build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ develop, master ] |
| 6 | + tags: [ '*' ] |
| 7 | + pull_request: |
| 8 | + branches: [ develop ] |
| 9 | + |
| 10 | +jobs: |
| 11 | + xliff: |
| 12 | + runs-on: ubuntu-20.04 |
| 13 | + |
| 14 | + name: XML Lint (Xliff) |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v2 |
| 18 | + |
| 19 | + - name: Install libxml2-utils |
| 20 | + run: sudo apt install libxml2-utils |
| 21 | + |
| 22 | + - name: Running xmllint (Xliff) |
| 23 | + run: find Resources/Private/Language/ -name '*.xlf' -type f | xargs xmllint --noout --schema .Build/xliff-core-1.2-strict.xsd |
| 24 | + |
| 25 | + lint: |
| 26 | + runs-on: ubuntu-20.04 |
| 27 | + |
| 28 | + strategy: |
| 29 | + matrix: |
| 30 | + php-versions: ['7.4'] |
| 31 | + |
| 32 | + name: Lint PHP ${{ matrix.php-versions }} |
| 33 | + steps: |
| 34 | + - name: Checkout |
| 35 | + uses: actions/checkout@v2 |
| 36 | + |
| 37 | + - name: Setup PHP |
| 38 | + uses: shivammathur/setup-php@v2 |
| 39 | + with: |
| 40 | + php-version: ${{ matrix.php-versions }} |
| 41 | + |
| 42 | + - name: Running php lint with ${{ matrix.php-versions }} |
| 43 | + run: errors=$(find . -name \*.php ! -path "./.Build/*" -exec php -d display_errors=stderr -l "{}" 2>&1 >/dev/null \;) && echo "${errors}" && test -z "${errors}" |
| 44 | + |
| 45 | + phpunit: |
| 46 | + needs: lint |
| 47 | + |
| 48 | + runs-on: ubuntu-20.04 |
| 49 | + |
| 50 | + continue-on-error: ${{ matrix.env.experimental == true }} |
| 51 | + strategy: |
| 52 | + fail-fast: false |
| 53 | + matrix: |
| 54 | + env: |
| 55 | + - { php: 7.4, TYPO3_VERSION: ^11.0, TESTING_FRAMEWORK: ^6.6.2 } |
| 56 | + - { php: 7.4, TYPO3_VERSION: ^11.0, TESTING_FRAMEWORK: ^6.6.2, PREFER_LOWEST: "--prefer-lowest" } |
| 57 | + - { php: 7.4, TYPO3_VERSION: "dev-master", TESTING_FRAMEWORK: ^6.6.2, experimental: true } |
| 58 | + |
| 59 | + env: ${{ matrix.env }} |
| 60 | + |
| 61 | + name: Run unit and/or functional tests on TYPO3 ${{ matrix.env.TYPO3_VERSION }} with PHP${{ matrix.env.php }} and testing framework ${{ matrix.env.TESTING_FRAMEWORK }} |
| 62 | + steps: |
| 63 | + - name: Checkout |
| 64 | + uses: actions/checkout@v2 |
| 65 | + |
| 66 | + - name: Setup PHP |
| 67 | + uses: shivammathur/setup-php@v2 |
| 68 | + with: |
| 69 | + php-version: ${{ matrix.env.php }} |
| 70 | + tools: composer |
| 71 | + extensions: pdo, sqlite3 |
| 72 | + |
| 73 | + - name: Validate composer.json and composer.lock |
| 74 | + run: composer validate |
| 75 | + |
| 76 | + - name: Cache dependencies |
| 77 | + uses: actions/cache@v1 |
| 78 | + with: |
| 79 | + path: ~/.composer/cache |
| 80 | + key: dependencies-composer-${{ hashFiles('composer.json') }} |
| 81 | + |
| 82 | + - name: Ensure stability dev |
| 83 | + if: ${{ matrix.env.TYPO3_VERSION == 'dev-master' }} |
| 84 | + run: | |
| 85 | + composer config minimum-stability dev |
| 86 | + composer config prefer-stable true |
| 87 | +
|
| 88 | + - name: Install TYPO3 core |
| 89 | + run: composer require typo3/cms-core="${TYPO3_VERSION}" ${PREFER_LOWEST}; |
| 90 | + |
| 91 | + - name: Install testing framework ${{ matrix.env.TESTING_FRAMEWORK }} |
| 92 | + if: ${{ matrix.env.TESTING_FRAMEWORK }} |
| 93 | + run: composer require --dev typo3/testing-framework="${TESTING_FRAMEWORK}"; |
| 94 | + |
| 95 | + - name: Reset composer.json |
| 96 | + run: git checkout composer.json; |
| 97 | + |
| 98 | + TERUpload: |
| 99 | + needs: [ xliff, lint, phpunit ] |
| 100 | + if: startsWith(github.ref, 'refs/tags/') |
| 101 | + |
| 102 | + runs-on: ubuntu-latest |
| 103 | + |
| 104 | + strategy: |
| 105 | + fail-fast: false |
| 106 | + |
| 107 | + name: TYPO3 TER release |
| 108 | + steps: |
| 109 | + - name: Checkout |
| 110 | + uses: actions/checkout@v2 |
| 111 | + |
| 112 | + - name: Publish to TER |
| 113 | + uses: tomasnorre/typo3-upload-ter@v1 |
| 114 | + with: |
| 115 | + api-token: ${{ secrets.TYPO3_API_TOKEN }} |
0 commit comments