Skip to content

Commit 3422f93

Browse files
committed
Simplify tests workflow
1 parent adc3036 commit 3422f93

File tree

1 file changed

+28
-59
lines changed

1 file changed

+28
-59
lines changed

.github/workflows/tests.yml

+28-59
Original file line numberDiff line numberDiff line change
@@ -6,89 +6,58 @@ on:
66
- main
77
pull_request:
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
phpUnitTests:
11-
runs-on: ubuntu-latest
12-
name: Unit Tests / PHP ${{ matrix.phpVersion }} / Winter ${{ matrix.winterRelease }}
1315
strategy:
14-
max-parallel: 6
1516
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']
1920
include:
2021
- phpVersion: '7.4'
21-
winterRelease: 'v1.1.9'
22-
winterReleaseDir: '1.1.9'
22+
winterBranch: '1.1'
2323
fail-fast: false
24+
25+
name: PHP ${{ matrix.phpVersion }} / Winter ${{ matrix.winterBranch }}
26+
runs-on: ${{ matrix.operatingSystem }}
27+
2428
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+
2831
steps:
29-
- name: Checkout changes
30-
uses: actions/checkout@v2
32+
- name: Checkout Winter CMS
33+
uses: actions/checkout@v4
3134
with:
32-
path: user-plugin
35+
repository: wintercms/winter
36+
ref: ${{ matrix.winterBranch }}
3337

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
4440
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
4842

49-
- name: Install PHP and extensions
43+
- name: Install PHP
5044
uses: shivammathur/setup-php@v2
5145
with:
5246
php-version: ${{ matrix.phpVersion }}
53-
extensions: ${{ env.phpExtensions }}
5447
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 }}
8049

8150
- name: Install Composer dependencies
82-
run: composer install --no-interaction --no-progress
51+
run: composer install --no-interaction --no-progress --no-scripts
8352

8453
- name: Run linting
8554
run: ./vendor/bin/parallel-lint plugins/winter/user
8655

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'
8958
run: php artisan winter:test -p Winter.User -- --testdox
9059

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'
9362
working-directory: plugins/winter/user
9463
run: ../../../vendor/bin/phpunit --bootstrap ../../../tests/bootstrap.php --testdox

0 commit comments

Comments
 (0)