-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
69 lines (61 loc) · 2.07 KB
/
Copy pathTaskfile.yml
File metadata and controls
69 lines (61 loc) · 2.07 KB
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
# https://taskfile.dev
version: '3.50'
vars:
PHP_VERSIONS: ['8.4', '8.5']
DEPENDENCY_VERSIONS: ['prefer-stable', 'prefer-lowest']
DEFAULT_PHP_VERSION: '8.5'
tasks:
default:
desc: 'List all available tasks'
silent: true
cmd: task --list
up:
desc: 'Up the PHP container(s) and install all Composer dependencies'
cmds:
- docker compose up --detach
- docker compose exec php-{{ .DEFAULT_PHP_VERSION }} composer install
down:
desc: 'Shutdown the PHP container(s)'
cmds:
- docker compose down
php:
desc: 'Open an interactive shell into one of the `php` services (see docker-compose.yml)'
summary: |
Open an interactive shell into one of the `php` services (see docker-compose.yml).
usage:
task php
task php version=<version>
task php dependency_versions=<dependency_versions>
task php version=<version> dependency_versions=<dependency_versions>
vars:
version: '{{ .version | default .DEFAULT_PHP_VERSION }}'
dependency_versions: '{{ .dependency_versions | default "prefer-stable" }}'
requires:
vars:
- name: version
enum:
ref: .PHP_VERSIONS
- name: dependency_versions
enum:
ref: .DEPENDENCY_VERSIONS
cmds:
- docker compose up --detach php-{{ .version }}
- docker compose exec php-{{ .version }} composer update --{{ .dependency_versions }} --prefer-dist
- docker compose exec php-{{ .version }} sh
test:
desc: 'Run the testsuite on all supported PHP versions'
summary: |
Run the testsuite on all supported PHP versions.
usage:
task test
cmds:
- docker compose up --detach
- for:
matrix:
PHP_VERSION:
ref: .PHP_VERSIONS
DEPENDENCY_VERSIONS:
ref: .DEPENDENCY_VERSIONS
cmd: |
docker compose exec php-{{ .ITEM.PHP_VERSION }} composer update --{{ .ITEM.DEPENDENCY_VERSIONS }} --prefer-dist
docker compose exec php-{{ .ITEM.PHP_VERSION }} composer test