Skip to content

Commit

Permalink
Merge pull request #682 from Austinb/bumbummen99-devcontainer
Browse files Browse the repository at this point in the history
Add devcontainer configuration
  • Loading branch information
bumbummen99 authored Nov 20, 2024
2 parents 628534b + 3a385ce commit 2ee9b79
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 10 deletions.
10 changes: 10 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/php
{
"name": "PHP",
"build": {
"dockerfile": "docker/Dockerfile"
},
"postCreateCommand": ".devcontainer/postCreate.sh",
"remoteUser": "vscode"
}
11 changes: 11 additions & 0 deletions .devcontainer/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Define the DevContainer template to be used as the base
ARG TAG=8.2-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/php:$TAG

# Update the registry once
RUN apt-get update

# Install ext-bz2
RUN apt-get install -y libbz2-dev \
&& docker-php-ext-configure bz2 \
&& docker-php-ext-install bz2
6 changes: 6 additions & 0 deletions .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Install dependencies using Composer
if [ ! -f composer.lock ]; then
composer install
fi
8 changes: 4 additions & 4 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ jobs:
run: |
composer global require php-coveralls/php-coveralls
php ~/.composer/vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
- name: Upload Scrutinizer coverage
uses: sudo-bot/action-scrutinizer@latest
if: github.repository == 'Austinb/GameQ'
run: |
composer global require scrutinizer/ocular ${{ matrix.ocular }}
php ~/.composer/vendor/bin/ocular code-coverage:upload --format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}
with:
cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
19 changes: 13 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@

# Development
/remotes/
test.php
/.buildpath
/.project
/.settings/*
vendor

# JetBrains
/.idea
*.iml

# Composer
vendor
composer.lock
composer.phar

# PHPUnit
.phpunit.result.cache
coverage/
build/logs/
test.php
*.iml
/remotes/
build/logs/
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Tests",
"type": "php",
"request": "launch",
"port": 0,
"cwd": "${workspaceFolder}",
"runtimeArgs": [
"-dxdebug.mode=debug,develop",
"-dxdebug.client_port=${port}",
"-dxdebug.start_with_request=yes"
],
"program": "${workspaceFolder}/vendor/bin/phpunit",
}
]
}
8 changes: 8 additions & 0 deletions GameQ.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}

0 comments on commit 2ee9b79

Please sign in to comment.