|
6 | 6 | - main
|
7 | 7 | pull_request:
|
8 | 8 |
|
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
9 | 13 | jobs:
|
10 | 14 | phpUnitTests:
|
11 |
| - runs-on: ubuntu-latest |
12 |
| - name: Unit Tests / PHP ${{ matrix.phpVersion }} / Winter ${{ matrix.winterRelease }} |
13 | 15 | strategy:
|
14 |
| - max-parallel: 6 |
15 | 16 | matrix:
|
16 |
| - phpVersion: ['8.0', '8.1'] |
17 |
| - winterRelease: ['develop'] |
18 |
| - winterReleaseDir: ['develop'] |
| 17 | + operatingSystem: [ubuntu-latest] |
| 18 | + phpVersion: ['8.0', '8.1', '8.2', '8.3'] |
| 19 | + winterBranch: ['develop'] |
19 | 20 | include:
|
20 | 21 | - phpVersion: '7.4'
|
21 |
| - winterRelease: 'v1.1.9' |
22 |
| - winterReleaseDir: '1.1.9' |
| 22 | + winterBranch: '1.1' |
23 | 23 | fail-fast: false
|
| 24 | + |
| 25 | + name: PHP ${{ matrix.phpVersion }} / Winter ${{ matrix.winterBranch }} |
| 26 | + runs-on: ${{ matrix.operatingSystem }} |
| 27 | + |
24 | 28 | env:
|
25 |
| - phpExtensions: mbstring, intl, gd, xml, sqlite |
26 |
| - cacheKey: ext-cache-v1 |
27 |
| - winterCmsRelease: develop |
| 29 | + extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_sqlite, sqlite3, xml, zip |
| 30 | + |
28 | 31 | steps:
|
29 |
| - - name: Checkout changes |
30 |
| - uses: actions/checkout@v2 |
| 32 | + - name: Checkout Winter CMS |
| 33 | + uses: actions/checkout@v4 |
31 | 34 | with:
|
32 |
| - path: user-plugin |
| 35 | + repository: wintercms/winter |
| 36 | + ref: ${{ matrix.winterBranch }} |
33 | 37 |
|
34 |
| - - name: Setup cache environment |
35 |
| - id: extcache |
36 |
| - uses: shivammathur/cache-extensions@v1 |
37 |
| - with: |
38 |
| - php-version: ${{ matrix.phpVersion }} |
39 |
| - extensions: ${{ env.phpExtensions }} |
40 |
| - key: ${{ env.cacheKey }} |
41 |
| - |
42 |
| - - name: Cache extensions |
43 |
| - uses: actions/cache@v2 |
| 38 | + - name: Checkout changes |
| 39 | + uses: actions/checkout@v2 |
44 | 40 | with:
|
45 |
| - path: ${{ steps.extcache.outputs.dir }} |
46 |
| - key: ${{ steps.extcache.outputs.key }} |
47 |
| - restore-keys: ${{ steps.extcache.outputs.key }} |
| 41 | + path: plugins/winter/user |
48 | 42 |
|
49 |
| - - name: Install PHP and extensions |
| 43 | + - name: Install PHP |
50 | 44 | uses: shivammathur/setup-php@v2
|
51 | 45 | with:
|
52 | 46 | php-version: ${{ matrix.phpVersion }}
|
53 |
| - extensions: ${{ env.phpExtensions }} |
54 | 47 | tools: composer:v2
|
55 |
| - coverage: none |
56 |
| - |
57 |
| - - name: Install Winter CMS |
58 |
| - run: | |
59 |
| - wget https://github.com/wintercms/winter/archive/${{ matrix.winterRelease }}.zip |
60 |
| - unzip ${{ matrix.winterRelease }}.zip |
61 |
| - rm ${{ matrix.winterRelease }}.zip |
62 |
| - shopt -s dotglob |
63 |
| - mv winter-${{ matrix.winterReleaseDir }}/* ./ |
64 |
| - rmdir winter-${{ matrix.winterReleaseDir }} |
65 |
| - shopt -u dotglob |
66 |
| - cp config/cms.php config/testing/cms.php |
67 |
| - mkdir -p plugins/winter |
68 |
| - mv user-plugin plugins/winter/user |
69 |
| -
|
70 |
| - - name: Get Composer cache directory |
71 |
| - id: composercache |
72 |
| - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
73 |
| - |
74 |
| - - name: Cache dependencies |
75 |
| - uses: actions/cache@v2 |
76 |
| - with: |
77 |
| - path: ${{ steps.composercache.outputs.dir }} |
78 |
| - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
79 |
| - restore-keys: ${{ runner.os }}-composer- |
| 48 | + extensions: ${{ env.extensions }} |
80 | 49 |
|
81 | 50 | - name: Install Composer dependencies
|
82 |
| - run: composer install --no-interaction --no-progress |
| 51 | + run: composer install --no-interaction --no-progress --no-scripts |
83 | 52 |
|
84 | 53 | - name: Run linting
|
85 | 54 | run: ./vendor/bin/parallel-lint plugins/winter/user
|
86 | 55 |
|
87 |
| - - name: Run unit tests (1.2/develop) |
88 |
| - if: matrix.winterRelease != 'v1.1.9' |
| 56 | + - name: Run unit tests (develop branch) |
| 57 | + if: matrix.winterBranch != '1.1' |
89 | 58 | run: php artisan winter:test -p Winter.User -- --testdox
|
90 | 59 |
|
91 |
| - - name: Run unit tests (1.1) |
92 |
| - if: matrix.winterRelease == 'v1.1.9' |
| 60 | + - name: Run unit tests (1.1 branch) |
| 61 | + if: matrix.winterBranch == '1.1' |
93 | 62 | working-directory: plugins/winter/user
|
94 | 63 | run: ../../../vendor/bin/phpunit --bootstrap ../../../tests/bootstrap.php --testdox
|
0 commit comments