-
Notifications
You must be signed in to change notification settings - Fork 75
87 lines (73 loc) · 3.2 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CI
# thanks go to derhansen for demo extension https://github.com/derhansen/gha_demo
# and blog https://www.derhansen.de/2020/05/typo3-extension-testing-with-github-actions.html
on: [push, pull_request]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.env.experimental == true }}
strategy:
fail-fast: false
matrix:
env:
- { php: 7.4, TYPO3_VERSION: ^11.0, TESTING_FRAMEWORK: 7.x-dev }
- { php: 8.0, TYPO3_VERSION: ^11.0, TESTING_FRAMEWORK: 7.x-dev }
- { php: 8.1, TYPO3_VERSION: ^11.0, TESTING_FRAMEWORK: 7.x-dev }
- { php: 8.2, TYPO3_VERSION: ^11.0, TESTING_FRAMEWORK: 7.x-dev, experimental: true }
- { php: 8.1, TYPO3_VERSION: ^12, TESTING_FRAMEWORK: 7.x-dev, experimental: true }
- { php: 8.2, TYPO3_VERSION: ^12, TESTING_FRAMEWORK: 7.x-dev, experimental: true }
- { php: 8.3, TYPO3_VERSION: ^12, TESTING_FRAMEWORK: 7.x-dev, experimental: true }
env: ${{ matrix.env }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.env.php }}
tools: composer
extensions: pdo, sqlite3
# composer
- name: Update Composer
run: |
sudo composer self-update
composer --version
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: dependencies-composer-${{ hashFiles('composer.json') }}
- name: Ensure stability dev
if: ${{ matrix.env.TYPO3_VERSION == 'dev-master' }}
run: |
composer config minimum-stability dev
composer config prefer-stable true
- name: Install TYPO3 core
run: composer require typo3/cms-core="${TYPO3_VERSION}" ${PREFER_LOWEST};
- name: Install testing framework ${{ matrix.env.TESTING_FRAMEWORK }}
if: ${{ matrix.env.TESTING_FRAMEWORK }}
run: composer require --dev typo3/testing-framework="${TESTING_FRAMEWORK}";
# unit tests
- name: Unit Tests
run: |
echo "Running ${TYPO3_VERSION} unit tests with $(which php)";
.Build/bin/phpunit -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml Tests/Unit/;
# start db
- name: Start MySQL
run: sudo /etc/init.d/mysql start
# functional tests
- name: Functional Tests
run: |
export typo3DatabaseName="typo3";
export typo3DatabaseHost="127.0.0.1";
export typo3DatabaseUsername="root";
export typo3DatabasePassword="root";
.Build/bin/phpunit --colors -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml Tests/Functional
- name: Reset composer.json
run: git checkout composer.json;