phpvms/.mise.toml
2026-06-02 15:40:01 -05:00

106 lines
2.4 KiB
TOML

[env]
BUILDKIT_HOST = "docker-container://buildkit"
PHPRC = "resources/mise"
_.php = {
prebuilt_static = true,
prebuilt_static_flavor = "bulk",
extra_configure_options = "--with-pdo-mysql --with-pdo-pgsql",
pie_extensions = "redis/phpredis xdebug/xdebug"
}
[tools]
php = "8.5.6"
[plugins]
php = "https://github.com/verzly/mise-php#latest"
[hooks]
postinstall = "composer install"
[settings]
task_output = "interleave"
# -----------------------------------------------
# Local tasks
# mise run setup
# -----------------------------------------------
[tasks.setup]
run = [
"mise install",
"mise run run-buildkit-container || true"
]
[tasks.run-buildkit-container]
run = "docker run --rm --privileged -d --name buildkit -e BUILDKIT_DEBUG=1 moby/buildkit:latest"
[tasks.railpack]
run = "railpack build ."
# -----------------------------------------------
# Test against real databases
# -----------------------------------------------
[tasks.test-db-up]
description = "Start MySQL and PostgreSQL for testing"
usage='''
arg "[db]" default="mysql" help="Run on mysql or pgsql?" {
choices "mysql" "pgsql"
}
'''
run = '''
docker compose -f compose.test.yml up {{ usage.db }} -d --wait
'''
[tasks.test-db-down]
description = "Stop test databases and remove volumes"
usage='''
arg "[db]" default="mysql" help="Run on mysql or pgsql?" {
choices "mysql" "pgsql"
}
'''
run = '''
docker compose -f compose.test.yml down {{ usage.db }} -v
'''
[tasks.'tests:mysql']
description = "Run tests against MySQL (port 13306)"
depends = [{ task = "test-db-up", args = ["mysql"]}]
depends_post = [{ task = "test-db-down", args = ["mysql"]}]
env = {
DB_CONNECTION = 'mysql',
DB_HOST = '127.0.0.1',
DB_PORT = "13306",
DB_DATABASE = "testing",
DB_USERNAME = "root",
DB_PASSWORD = "password"
}
run = [
"vendor/bin/pest --compact --parallel --bail"
]
[tasks.'tests:pgsql']
description = "Run tests against PostgreSQL (port 15432)"
depends = [{ task = "test-db-up", args = ["pgsql"]}]
depends_post = [{ task = "test-db-down", args = ["pgsql"]}]
env = {
DB_CONNECTION = 'pgsql',
DB_HOST = '127.0.0.1',
DB_PORT = "15432",
DB_DATABASE = "testing",
DB_USERNAME = "phpvms",
DB_PASSWORD = "password"
}
run = [
"vendor/bin/pest --compact --parallel --bail"
]
# Run the github workflows locally using act
[tasks.'tests:actions']
run = '''
act \
--rm \
--container-architecture linux/amd64 pull_request
'''