Skip to content

Commit

Permalink
Merge pull request #149 from fsr5-fhaachen/dev
Browse files Browse the repository at this point in the history
merge dev into main
  • Loading branch information
simonostendorf authored Oct 29, 2024
2 parents bc3b888 + 715b515 commit 53bc5ab
Show file tree
Hide file tree
Showing 117 changed files with 8,420 additions and 76,401 deletions.
37 changes: 18 additions & 19 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// https://aka.ms/devcontainer.json
{
"name": "Laravel Sail",
"dockerComposeFile": [
"../docker-compose.yml"
],
"service": "laravel.test",
"workspaceFolder": "/var/www/html",
"customizations": {
"vscode": {
"extensions": [
"name": "Laravel Sail",
"dockerComposeFile": ["../docker-compose.sail.yaml"],
"service": "laravel.test",
"workspaceFolder": "/var/www/html",
"customizations": {
"vscode": {
"extensions": [
"bmewburn.vscode-intelephense-client",
"bradlc.vscode-tailwindcss",
"christian-kohler.path-intellisense",
Expand All @@ -22,14 +20,15 @@
"neilbrayfield.php-docblocker",
"steoates.autoimport",
"Vue.volar",
"xdebug.php-debug"
],
"settings": {}
}
},
"remoteUser": "sail",
"postCreateCommand": "chown -R 1000:1000 /var/www/html"
// "forwardPorts": [],
// "runServices": [],
// "shutdownAction": "none",
"xdebug.php-debug",
"github.copilot"
],
"settings": {}
}
},
"remoteUser": "sail",
"postCreateCommand": "chown -R 1000:1000 /var/www/html"
// "forwardPorts": [],
// "runServices": [],
// "shutdownAction": "none",
}
28 changes: 22 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

APP_TIMEZONE=UTC
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database
BCRYPT_ROUNDS=12
APP_PUBLIC_URL=http://localhost
APP_IS_VPN=false
APP_FORCE_HTTPS=false

APP_PORTALS_URL=http://127.0.0.1:8000
APP_PORTALS_API_SECRET=secret
Expand All @@ -16,6 +25,7 @@ TELEGRAM_BOT_WARNING_CHANNEL_ID=
CSV_EXPORT_PW=

LOG_CHANNEL=stack
LOG_STACK=single
LOG_LEVEL=debug

DB_CONNECTION=mysql
Expand All @@ -25,15 +35,19 @@ DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
BROADCAST_CONNECTION=log
CACHE_STORE=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=database
SESSION_LIFETIME=720
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

MEMCACHED_HOST=127.0.0.1

REDIS_URL=
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
Expand All @@ -58,9 +72,11 @@ PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

OCTANE_HTTPS=false
OCTANE_WORKERS=4
OCTANE_MAX_REQUESTS=512
OCTANE_MAX_REQUESTS=512
OCTANE_SERVER=frankenphp
27 changes: 20 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ jobs:

strategy:
matrix:
php-version: ["8.0"]
node-version: [16.x]
php-version: ["8.3"]
node-version: [20.x]

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.4.1
uses: actions/setup-node@v4.0.3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
Expand All @@ -33,7 +33,14 @@ jobs:
run: composer update --ignore-platform-req=php+ --no-interaction --no-progress
- name: Install Node.js Dependencies
run: |
npm ci --force --legacy-peer-deps
npm ci
# waits for https://github.com/fsr5-fhaachen/strichlistensystem/issues/99
# - name: Execute Node.js linting
# run: |
# npm run lint
# - name: Execute PHP linting
# run: |
# ./vendor/bin/pint
- name: Execute build
run: npm run build --if-present
- name: Generate key
Expand All @@ -50,8 +57,14 @@ jobs:
DB_DATABASE: database/database.sqlite
run: |
php artisan migrate
- name: Execute tests (Unit and Feature tests) via PHPUnit
- name: Execute seeders
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: vendor/bin/phpunit
run: |
php artisan db:seed
# - name: Execute tests (Unit and Feature tests) via PHPUnit
# env:
# DB_CONNECTION: sqlite
# DB_DATABASE: database/database.sqlite
# run: vendor/bin/phpunit
27 changes: 0 additions & 27 deletions .github/workflows/docker-dev.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/docker-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Docker e2e Test

on:
pull_request: {}

env:
IMAGE_REGISTRY: ghcr.io
IMAGE_PATH: ${{ github.repository }}
IMAGE_TAG: ${{ github.ref_name }}

jobs:
e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Image
uses: docker/build-push-action@v6
with:
push: false
load: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:latest
- name: Create Environment
run: |
cat > .env << EOF
APP_NAME="Erstiwoche FB5"
APP_ENV=local
APP_KEY=1234567890ABCDEFGHIJ1234567890AB
APP_DEBUG=true
APP_URL=http://localhost
APP_FORCE_HTTPS=false
APP_EVENT_TYPE=demo
TUTOR_PASSWORD=password
ADMIN_PASSWORD=admin
LOG_CHANNEL=stack
LOG_LEVEL=debug
BROADCAST_CONNECTION=log
CACHE_STORE=file # TODO
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file # TODO
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
OCTANE_HTTPS=false
OCTANE_WORKERS=1
OCTANE_MAX_REQUESTS=512
WWWGROUP=1000
WWWUSER=1000
OCTANE_SERVER=roadrunner
EOF
- name: Run Image
uses: isbang/compose-action@v2.0.1
with:
compose-file: "docker-compose.yaml"
down-flags: "--volumes"
- name: Wait
run: |
# wait 10 seconds for the docker container to start
sleep 10
- name: Run DB Seed
run: |
# run "php artisan migrate:fresh --seed" inside docker container
docker exec strichlistensystem-web php artisan migrate:fresh --seed
- name: Debug
run: |
curl http://localhost:8000
- name: Test reachable
run: |
# test every 10 seconds if http://localhost:8000 is reachable and has a OK status code. Timeout after 2 minutes
timeout 120 bash -c 'until curl --output /dev/null --silent --head --fail http://localhost:8000; do printf "."; sleep 10; done'
51 changes: 37 additions & 14 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,51 @@
name: Docker CI (release)
name: Docker Release

on:
release:
types: [published]
types:
- published
push:
branches:
- dev

env:
REGISTRY: ghcr.io
IMAGE_REGISTRY: ghcr.io
IMAGE_PATH: ${{ github.repository }}
IMAGE_TAG: ${{ github.ref_name }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
uses: actions/checkout@v4
- name: Get latest release
id: latest_release
uses: pozetroninc/github-action-get-latest-release@master
with:
registry: ${{ env.REGISTRY }}
repository: ${{ github.repository }}
excludes: prerelease, draft
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push docker
run: |
docker build -f ./Dockerfile . --tag ${{ env.REGISTRY }}/fsr5-fhaachen/strichlistensystem:${{ env.RELEASE_VERSION }} --tag ${{ env.REGISTRY }}/fsr5-fhaachen/strichlistensystem:latest
docker push ${{ env.REGISTRY }}/fsr5-fhaachen/strichlistensystem:${{ env.RELEASE_VERSION }}
docker push ${{ env.REGISTRY }}/fsr5-fhaachen/strichlistensystem:latest
- name: Build and push (latest release)
uses: docker/build-push-action@v6
if: ${{ github.event_name == 'release' && steps.latest_release.outputs.release == github.ref_name }} # run only on latest release
with:
push: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}, ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:latest
- name: Build and push (release)
uses: docker/build-push-action@v6
if: ${{ github.event_name == 'release' && steps.latest_release.outputs.release != github.ref_name }} # run only on release (not latest)
with:
push: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}
- name: Build and push (push)
uses: docker/build-push-action@v6
if: ${{ github.event_name == 'push' }} # run only on push (to dev)
with:
push: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}
Loading

0 comments on commit 53bc5ab

Please sign in to comment.