Skip to content

Commit eef2eb1

Browse files
Added docker stuff and removed phpcomp since the last update was ages ago
1 parent 7e0963d commit eef2eb1

File tree

18 files changed

+221
-36
lines changed

18 files changed

+221
-36
lines changed

.env.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# UID and GID of your current user (e.g. wwwdev or developer). Can be looked up by using the linux command "id"
2+
# By default it is 1001 for vagrant vms (vagrant is 1000 and the next user is 1001)
3+
UID=1001
4+
GID=1001
5+
SSH_AUTH_SOCK=/run/user/1001/keyring/ssh

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ updates:
1010
schedule:
1111
interval: "daily"
1212

13+
- package-ecosystem: "docker"
14+
directory: "/"
15+
schedule:
16+
interval: "daily"
17+
1318
- package-ecosystem: "github-actions"
1419
directory: "/"
1520
schedule:

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/.cache/*
22
/.logs/*
33
/test/.phpunit.result.cache
4-
!/**/.gitkeep
54
composer.phar
65
/vendor/
76
composer.lock
8-
/.idea
7+
/.idea
8+
/.env
9+
/tools/*
10+
!/**/.gitkeep

.installer/install.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
'vendor' => 'codenamephp',
2222
'componentName' => $componentName,
2323
'namespace' => implode('\\', array_merge(['de', 'codenamephp'], explode('.', $componentName))),
24+
'phpVersion' => '8.1',
2425
];
2526

2627
(new StepExecutor(

.installer/templates/.env

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# UID and GID of your current user (e.g. wwwdev or developer). Can be looked up by using the linux command "id"
2+
# By default it is 1001 for vagrant vms (vagrant is 1000 and the next user is 1001)
3+
UID=1001
4+
GID=1001
5+
SSH_AUTH_SOCK=/run/user/1001/keyring/ssh

.installer/templates/.env.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# UID and GID of your current user (e.g. wwwdev or developer). Can be looked up by using the linux command "id"
2+
# By default it is 1001 for vagrant vms (vagrant is 1000 and the next user is 1001)
3+
UID=1001
4+
GID=1001
5+
SSH_AUTH_SOCK=/run/user/1001/keyring/ssh
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release
8+
paths-ignore:
9+
- '**.md'
10+
pull_request:
11+
branches:
12+
- main
13+
- release
14+
paths-ignore:
15+
- '**.md'
16+
17+
jobs:
18+
test_latest:
19+
strategy:
20+
matrix:
21+
php-versions: [ '{{phpVersion}}' ]
22+
prefer: [ 'prefer-lowest', 'prefer-stable' ]
23+
name: Test with ${{ matrix.prefer }} dependency versions on PHP ${{ matrix.php-versions }}
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
30+
- name: Setup PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php-versions }}
34+
coverage: xdebug
35+
36+
- name: Validate composer.json
37+
run: composer validate
38+
39+
- name: Get Composer Cache Directory
40+
id: composer-cache
41+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
42+
- name: Setup cache
43+
uses: actions/cache@v2
44+
with:
45+
path: ${{ steps.composer-cache.outputs.dir }}
46+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.prefer }}-
47+
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-
48+
49+
- name: Install dependencies
50+
if: steps.composer-cache.outputs.cache-hit != 'true'
51+
run: composer update --prefer-dist --no-ansi --no-interaction --no-progress --${{ matrix.prefer }}
52+
53+
- name: Run CI tools
54+
run: composer ci-all

.installer/templates/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/.logs/*
33
/test/.phpunit.result.cache
44
!/**/.gitkeep
5+
.env
56

67
# Created by https://www.toptal.com/developers/gitignore/api/composer,phpstorm
78
# Edit at https://www.toptal.com/developers/gitignore?templates=composer,phpstorm

.installer/templates/composer.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^8.0"
14-
},
15-
"require-dev": {
16-
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
17-
"phpcompatibility/php-compatibility": "^9.0",
18-
"squizlabs/php_codesniffer": "^3.5"
13+
"php": "^{{phpVersion}}"
1914
},
2015
"autoload": {
2116
"psr-4": {
@@ -38,13 +33,11 @@
3833
"phive-update": "phive update && git add tools/* phive.xml && git commit -m 'Updated phive dependencies'",
3934
"phpunit": "tools/phpunit.phar -c test/phpunit.dist.xml test/",
4035
"psalm": "tools/psalm --threads=10 --long-progress",
41-
"phpcomp": "vendor/bin/phpcs --cache=.cache/phpcomp.cache --standard=phpcomp.xml --parallel=10 --extensions=php --ignore=autoload.php src/*",
4236
"composer-unused": "tools/composer-unused --no-progress --no-interaction --profile",
4337
"composer-require-checker": "tools/composer-require-checker --no-interaction",
4438
"infection": "XDEBUG_MODE=coverage tools/infection --min-msi=95 --min-covered-msi=95 --threads=4 --no-progress --show-mutations",
4539
"ci-all": [
4640
"@phpunit",
47-
"@phpcomp",
4841
"@psalm",
4942
"@composer-unused",
5043
"@infection"
@@ -53,7 +46,6 @@
5346
"scripts-descriptions": {
5447
"phive-update": "Runs a phive update and commits all tools and the phive.xml so PHPStorm won't run code formatting on the phars",
5548
"phpunit": "Runs phpunit tests",
56-
"phpcomp": "Runs php compatibility checks",
5749
"psalm": "Runs psalm static analysis",
5850
"composer-unused": "Checks for unused composer packages",
5951
"composer-require-checker": "Checks for missing required composer packages",
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: '3.6'
2+
3+
services:
4+
application:
5+
user: "${UID}:${GID}" #don't run as root by default to prevent permission conflicts
6+
build:
7+
context: docker/application
8+
args:
9+
UID: ${UID:-1000}
10+
GID: ${GID:-1000}
11+
volumes:
12+
- ./:/app
13+
- $HOME/.phive:/home/application/.phive
14+
- $HOME/.ssh:/home/application/.ssh
15+
- ${SSH_AUTH_SOCK:-/ssh-agent}:/ssh-agent # Forward local machine SSH key to docker
16+
- /etc/timezone:/etc/timezone:ro
17+
- /etc/localtime:/etc/localtime:ro
18+
# cap and privileged needed for slowlog
19+
cap_add:
20+
- SYS_PTRACE
21+
privileged: true
22+
env_file:
23+
- docker/application/environment.yml
24+
environment:
25+
- SSH_AUTH_SOCK=/ssh-agent

0 commit comments

Comments
 (0)