Skip to content

Commit

Permalink
add devcontainer and launch profile for VS Code
Browse files Browse the repository at this point in the history
  • Loading branch information
mindplay-dk committed May 29, 2024
1 parent 4a793de commit bae1179
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "mindplay/sql",
"dockerComposeFile": "../docker-compose.yml",
"service": "php",
"workspaceFolder": "/app",
"customizations": {
"vscode": {
"extensions": [
"DEVSENSE.phptools-vscode",
"xdebug.php-debug"
]
},
"settings": {
"php.validate.executablePath": "/usr/local/bin/php"
}
},
"postCreateCommand": "composer update"
}
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug test/test.php",
"type": "php",
"request": "launch",
"cwd": "/app",
"program": "/app/test/test.php",
"externalConsole": false,
"port": 9003
}
]
}
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN apt-get update && apt-get install -y \
libpq-dev \
mariadb-client \
unzip \
git \
&& docker-php-ext-install pdo pdo_mysql pdo_pgsql

# Install xdebug
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ Code adheres to [PSR-2](http://www.php-fig.org/psr/psr-2/) and [PSR-4](http://ww

You need a working [Docker](https://docs.docker.com/get-docker/) installation to run the tests.

#### Using VS Code

The project includes a [DevContainer](https://containers.dev/) and a `launch.json` for testing and debugging
with VS Code - just open the project in VS Code, hit `F5` to run the tests, and you should be good to go. ✨

#### Using Docker

To launch Docker and run the test-suite, e.g. in PHP `8.3`:

./test.sh 8.3
Expand Down

0 comments on commit bae1179

Please sign in to comment.