name: CI on: push: branches: [main, develop] pull_request: jobs: tests: name: PHP ${{ matrix.php }} / ${{ matrix.db }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: php: ['8.3', '8.4'] db: ['mysql:8.0', 'mysql:8.4', 'mariadb:10.6', 'mariadb:11.4'] services: db: image: ${{ matrix.db }} env: MYSQL_DATABASE: inhaus_test MYSQL_USER: inhaus MYSQL_PASSWORD: inhaus MYSQL_ROOT_PASSWORD: root MARIADB_DATABASE: inhaus_test MARIADB_USER: inhaus MARIADB_PASSWORD: inhaus MARIADB_ROOT_PASSWORD: root env: DB_HOST: db DB_PORT: 3306 DB_USERNAME: inhaus DB_PASSWORD: inhaus COMPOSER_VENDOR_DIR: vendor-dev steps: - uses: https://code.forgejo.org/actions/checkout@v4 - uses: https://github.com/shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: intl, zip, gd, pdo_mysql, bcmath, exif coverage: none - run: composer install --no-interaction --no-progress - run: cp .env.example .env && php artisan key:generate - name: Auf Datenbank warten run: | for i in $(seq 1 30); do php -r 'try { new PDO("mysql:host=db;port=3306", "inhaus", "inhaus"); exit(0); } catch (Exception $e) { exit(1); }' && exit 0 sleep 2 done exit 1 - run: vendor-dev/bin/phpunit - run: vendor-dev/bin/pint --test audit: name: Bekannte Sicherheitslücken in Paketen runs-on: ubuntu-latest steps: - uses: https://code.forgejo.org/actions/checkout@v4 - uses: https://github.com/shivammathur/setup-php@v2 with: php-version: '8.4' coverage: none - run: composer audit --locked --no-dev - uses: https://code.forgejo.org/actions/setup-node@v4 with: node-version: '22' - run: npm audit --omit=dev --audit-level=high artifacts: name: Build-Artefakte aktuell runs-on: ubuntu-latest steps: - uses: https://code.forgejo.org/actions/checkout@v4 - uses: https://github.com/shivammathur/setup-php@v2 with: php-version: '8.3' extensions: intl, zip, gd, pdo_mysql, bcmath, exif coverage: none - uses: https://code.forgejo.org/actions/setup-node@v4 with: node-version: '24' - name: vendor/ entspricht composer.lock (ohne Dev-Pakete) run: | composer install --no-dev --optimize-autoloader --no-interaction --no-progress --no-scripts # installed.php enthält den Git-Commit des Projekts selbst und ändert sich daher immer. git status --porcelain -- vendor ':!vendor/composer/installed.php' test -z "$(git status --porcelain -- vendor ':!vendor/composer/installed.php')" - name: public/build/ entspricht dem Quellcode run: | npm ci --no-audit --no-fund npm run build git status --porcelain public/build test -z "$(git status --porcelain public/build)"