Update README.md #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| phpUnitTests: | |
| runs-on: ubuntu-latest | |
| name: Unit Tests / PHP ${{ matrix.phpVersion }} / Winter ${{ matrix.winterRelease }} | |
| strategy: | |
| max-parallel: 6 | |
| matrix: | |
| phpVersion: ['8.0', '8.1', '8.2'] | |
| winterRelease: ['develop'] | |
| winterReleaseDir: ['develop'] | |
| fail-fast: false | |
| env: | |
| phpExtensions: mbstring, intl, gd, xml, sqlite | |
| cacheKey: ext-cache-v1 | |
| winterCmsRelease: develop | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Checkout changes | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Run Super-Linter | |
| uses: github/super-linter@v4 | |
| env: | |
| DEFAULT_BRANCH: main | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| VALIDATE_YAML: true | |
| VALIDATE_JSON: true | |
| VALIDATE_MARKDOWN: true | |
| VALIDATE_PHP_BUILTIN: true | |
| - name: Move files to a widgets-plugin directory | |
| run: mkdir widgets-plugin && find . -mindepth 1 -maxdepth 1 ! -name 'widgets-plugin' -exec mv -t widgets-plugin -- {} + | |
| - name: Setup cache environment | |
| id: extcache | |
| uses: shivammathur/cache-extensions@v1 | |
| with: | |
| php-version: ${{ matrix.phpVersion }} | |
| extensions: ${{ env.phpExtensions }} | |
| key: ${{ env.cacheKey }} | |
| - name: Cache extensions | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.extcache.outputs.dir }} | |
| key: ${{ steps.extcache.outputs.key }} | |
| restore-keys: ${{ steps.extcache.outputs.key }} | |
| - name: Install PHP and extensions | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.phpVersion }} | |
| extensions: ${{ env.phpExtensions }} | |
| - name: Install Winter CMS | |
| run: | | |
| wget https://github.com/wintercms/winter/archive/${{ matrix.winterRelease }}.zip | |
| unzip ${{ matrix.winterRelease }}.zip | |
| rm ${{ matrix.winterRelease }}.zip | |
| shopt -s dotglob | |
| mv winter-${{ matrix.winterReleaseDir }}/* ./ | |
| rmdir winter-${{ matrix.winterReleaseDir }} | |
| shopt -u dotglob | |
| cp config/cms.php config/testing/cms.php | |
| mkdir -p plugins/numencode | |
| mv widgets-plugin plugins/numencode/widgets | |
| - name: Download NumenCode.Fundamentals plugin | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cd plugins/numencode | |
| git clone https://github.com/numencode/wn-fundamentals-plugin.git fundamentals | |
| - name: Download Winter.Translate plugin | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| mkdir -p plugins/winter | |
| cd plugins/winter | |
| git clone https://github.com/wintercms/wn-translate-plugin.git translate | |
| - name: Get Composer cache directory | |
| id: composercache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_ENV | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install Composer dependencies | |
| run: composer install --no-interaction --no-progress --no-suggest | |
| - name: Run unit tests | |
| run: php artisan winter:test -p NumenCode.Widgets --configuration=plugins/numencode/widgets/phpunit.xml |