Skip to content

Commit 078f18b

Browse files
committed
Merge branch 'upstream_master' into merge_upstream_master
2 parents 6c77179 + da40db7 commit 078f18b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+8498
-3941
lines changed

.devcontainer/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM mcr.microsoft.com/devcontainers/php:8.2
2+
3+
# Create Laravel test project directory in vscode user home
4+
USER vscode
5+
RUN mkdir -p /home/vscode/laravel-test
6+
7+
# Expose port 8000 for Laravel
8+
EXPOSE 8000
9+
10+
# Create setup script for Laravel test environment
11+
COPY ./setup-laravel-test.sh /usr/local/bin/setup-laravel-test.sh
12+
USER root
13+
RUN chmod +x /usr/local/bin/setup-laravel-test.sh
14+
USER vscode

.devcontainer/devcontainer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/php
3+
{
4+
"name": "Laravel SCIM Server Dev",
5+
// Use the Dockerfile in the .devcontainer folder
6+
"build": {
7+
"dockerfile": "Dockerfile",
8+
"context": "."
9+
},
10+
11+
// Configure tool-specific properties
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"bmewburn.vscode-intelephense-client",
16+
"xdebug.php-debug",
17+
"mikestead.dotenv",
18+
"mehedidracula.php-namespace-resolver",
19+
"recca0120.vscode-phpunit",
20+
"formulahendry.terminal",
21+
"junstyle.php-cs-fixer"
22+
],
23+
"settings": {
24+
"php.validate.executablePath": "/usr/local/bin/php"
25+
}
26+
}
27+
},
28+
29+
// Use 'forwardPorts' to make a list of ports inside the container available locally
30+
"forwardPorts": [8000],
31+
32+
// Use 'postCreateCommand' to run commands after the container is created
33+
"postCreateCommand": "composer install",
34+
35+
// Add a non-root user to run the server
36+
"remoteUser": "vscode"
37+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Create Laravel project if it doesn't exist
5+
if [ ! -d "/home/vscode/laravel-test/vendor" ]; then
6+
echo "Creating new Laravel project..."
7+
cd /home/vscode
8+
composer create-project --prefer-dist laravel/laravel laravel-test
9+
10+
cd laravel-test
11+
12+
# Add the local package as a repository
13+
jq '.repositories=[{"type": "path","url": "/workspaces/laravel-scim-server"}]' ./composer.json > composer.json.tmp && mv composer.json.tmp composer.json
14+
15+
# Require the package and laravel/tinker
16+
composer require arietimmerman/laravel-scim-server @dev
17+
composer require laravel/tinker
18+
19+
# Set up SQLite database
20+
touch ./.database.sqlite
21+
echo "DB_CONNECTION=sqlite" >> ./.env
22+
echo "DB_DATABASE=/home/vscode/laravel-test/.database.sqlite" >> ./.env
23+
24+
# Run migrations
25+
php artisan migrate
26+
27+
# Create test users
28+
echo "User::factory()->count(100)->create();" | php artisan tinker
29+
30+
echo "Laravel test environment setup complete!"
31+
else
32+
echo "Laravel test environment already exists!"
33+
fi

.github/workflows/ci.yml

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,72 @@
11
name: CI
22

3-
on: [push]
3+
on: ['push', 'pull_request']
4+
5+
permissions:
6+
contents: read
7+
packages: write
48

59
jobs:
6-
build-test:
10+
tests:
711
runs-on: ubuntu-latest
812
continue-on-error: true
913
strategy:
1014
matrix:
11-
php: [7.3, 7.4, 8.0, 8.1, 8.2]
12-
laravel: [6.*, 7.*, 8.*, 9.*, 10.*]
15+
php: [8.0, 8.1, 8.2]
16+
laravel: [10.*, 11.*, 12.*]
1317
exclude:
14-
- laravel: 6.*
15-
php: 8.1
16-
- laravel: 6.*
17-
php: 8.2
18-
- laravel: 7.*
19-
php: 8.1
20-
- laravel: 7.*
21-
php: 8.2
22-
- laravel: 9.*
18+
- laravel: 10.*
19+
php: 8.0
20+
- laravel: 11.*
2321
php: 7.3
24-
- laravel: 9.*
22+
- laravel: 11.*
2523
php: 7.4
26-
- laravel: 10.*
24+
- laravel: 11.*
25+
php: 8.0
26+
- laravel: 11.*
27+
php: 8.1
28+
- laravel: 12.*
2729
php: 7.3
28-
- laravel: 10.*
30+
- laravel: 12.*
2931
php: 7.4
30-
- laravel: 10.*
32+
- laravel: 12.*
3133
php: 8.0
34+
- laravel: 12.*
35+
php: 8.1
3236

3337
name: PHP ${{ matrix.php }} on Laravel ${{ matrix.laravel }}
3438

3539
steps:
36-
- uses: actions/checkout@v2
37-
- uses: php-actions/composer@v6
38-
with:
39-
php_version: 8
40-
- uses: php-actions/phpunit@v3
40+
- name: Checkout code
41+
uses: actions/checkout@v2
42+
- name: Setup PHP
43+
uses: shivammathur/setup-php@v2
4144
with:
42-
php_version: 8
45+
php-version: ${{ matrix.php }}
46+
- name: Install dependencies
47+
run: |
48+
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/database:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" --no-interaction --no-update
49+
composer update
50+
- name: Run tests
51+
run: vendor/bin/phpunit
52+
53+
docker:
54+
# Only push Docker image for direct pushes to master branch
55+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
56+
runs-on: ubuntu-latest
57+
needs: tests
58+
steps:
59+
- name: Checkout code
60+
uses: actions/checkout@v4
61+
- name: Log in to the Container registry
62+
uses: docker/login-action@v3
63+
with:
64+
registry: ghcr.io
65+
username: ${{ github.actor }}
66+
password: ${{ secrets.GITHUB_TOKEN }}
67+
- name: Build and push Docker image
68+
uses: docker/build-push-action@v5
69+
with:
70+
context: .
71+
push: true
72+
tags: ghcr.io/${{ github.repository }}:latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
vendor
2+
.phpunit.result.cache

.vscode/launch.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
8+
{
9+
"name": "Listen for Xdebug",
10+
"type": "php",
11+
"request": "launch",
12+
"port": 9000
13+
},
14+
{
15+
"name": "Launch currently open script",
16+
"type": "php",
17+
"request": "launch",
18+
"program": "${file}",
19+
"cwd": "${fileDirname}",
20+
"port": 0,
21+
"runtimeArgs": [
22+
"-dxdebug.start_with_request=yes"
23+
],
24+
"env": {
25+
"XDEBUG_MODE": "debug,develop",
26+
"XDEBUG_CONFIG": "client_port=${port}"
27+
}
28+
},
29+
{
30+
"name": "Launch Built-in web server",
31+
"type": "php",
32+
"request": "launch",
33+
"runtimeArgs": [
34+
"-dxdebug.mode=debug",
35+
"-dxdebug.start_with_request=yes",
36+
"-S",
37+
"localhost:0"
38+
],
39+
"program": "",
40+
"cwd": "${workspaceRoot}",
41+
"port": 9003,
42+
"serverReadyAction": {
43+
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
44+
"uriFormat": "http://localhost:%s",
45+
"action": "openExternally"
46+
}
47+
}
48+
]
49+
}

.vscode/settings.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"php.validate.enable": true,
3+
"php.validate.run": "onType",
4+
"php.validate.executablePath": "/usr/local/bin/php",
5+
"php-cs-fixer.executablePath": "/workspaces/laravel-scim-server/vendor/bin/php-cs-fixer",
6+
"files.associations": {
7+
"*.php": "php"
8+
},
9+
"[php]": {
10+
"editor.formatOnSave": true
11+
}
12+
}

.vscode/tasks.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Setup Laravel SCIM Test Server",
6+
"type": "shell",
7+
"command": "setup-laravel-test.sh",
8+
"problemMatcher": [],
9+
"presentation": {
10+
"reveal": "always",
11+
"panel": "new"
12+
},
13+
"group": "test"
14+
},
15+
{
16+
"label": "Start Laravel SCIM Test Server",
17+
"type": "shell",
18+
"command": "export XDEBUG_MODE=debug,develop && cd /home/vscode/laravel-test && COMPOSER_AUTOLOAD_DEV=1 composer dump-autoload && php artisan serve --host=0.0.0.0 --port=8000",
19+
"dependsOn": "Setup Laravel SCIM Test Server",
20+
"problemMatcher": [],
21+
"presentation": {
22+
"reveal": "always",
23+
"panel": "dedicated"
24+
},
25+
"group": "test"
26+
},
27+
{
28+
"label": "Open SCIM Server in Browser",
29+
"type": "shell",
30+
"command": "$BROWSER http://localhost:8000/scim/v2/Users",
31+
"problemMatcher": [],
32+
"group": "test"
33+
}
34+
]
35+
}

0 commit comments

Comments
 (0)