Skip to content

Commit

Permalink
Merge branch 'main' into tests-php84
Browse files Browse the repository at this point in the history
* main: (49 commits)
  Remove unused `spatie/laravel-ray` dependency
  Configure run-tests on and schedule
  Run tests across MySQL, Postgres and SQLite (#142)
  Fix code styling
  Fix fetching of incident and schedule updateables
  Fix code styling
  Change integer types for status columns
  Compile Assets
  Update API endpoint descriptions
  Compile Assets
  Reinstate incident user relationship
  Update README.md incorrect sponsor URL (#141)
  Remove incorrect status field
  Fix code styling
  Larastan 3.x and fixes for the phpstan errors (#140)
  Fix Static Analysis check by removing types (#138)
  Fix code styling
  Add a `cachet:make:user` command (#139)
  Test fixing action
  Make User resource mixin of Authenticatable
  ...
  • Loading branch information
jbrooksuk committed Dec 18, 2024
2 parents 78f52ae + 3150651 commit 8cd20c6
Show file tree
Hide file tree
Showing 177 changed files with 2,748 additions and 1,635 deletions.
4 changes: 2 additions & 2 deletions .github/DEPENDABOT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: weekly
day: monday
interval: daily
time: "07:00"
groups:
php-dependencies:
update-types:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/compile-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
php-version: 8.3
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

Expand All @@ -27,7 +27,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22

- name: Install NPM dependencies
run: npm ci
Expand Down
177 changes: 169 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
name: run-tests

on: [push, pull_request]
on:
push:
branches:
- main
- '*.x'
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
test:
runs-on: ${{ matrix.os }}
static-analysis:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.4, 8.3, 8.2]
laravel: [11.x]
stability: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
name: Static Analysis - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }}

steps:
- name: Checkout code
Expand All @@ -26,10 +32,150 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

- name: Setup problem matchers
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Run PHPStan
run: vendor/bin/phpstan --error-format=github

mysql:
runs-on: ubuntu-latest

services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: cachet
MYSQL_USER: cachet
MYSQL_PASSWORD: password
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
fail-fast: false
matrix:
php: [8.4, 8.3, 8.2]
laravel: [11.x]
stability: [prefer-lowest, prefer-stable]

name: Tests - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - MySQL 8.0

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Install frontend dependencies
run: npm ci

- name: Build assets
run: npm run build

- name: Build tests environment
run: composer build

- name: Execute tests
run: composer test
env:
DB_CONNECTION: mysql
DB_HOST: localhost
DB_DATABASE: cachet
DB_USERNAME: cachet
DB_PASSWORD: password

postgres:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:13
env:
POSTGRES_DB: cachet
POSTGRES_USER: cachet
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
fail-fast: false
matrix:
php: [8.4, 8.3, 8.2]
laravel: [11.x]
stability: [prefer-lowest, prefer-stable]

name: Tests - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - PostgreSQL 13

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

- name: Install dependencies
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Install frontend dependencies
run: npm ci

- name: Build assets
run: npm run build

- name: Build tests environment
run: composer build

- name: Execute tests
run: composer test
env:
DB_CONNECTION: mysql
DB_HOST: localhost
DB_DATABASE: cachet
DB_USERNAME: cachet
DB_PASSWORD: password

sqlite:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ 8.3, 8.2 ]
laravel: [ 11.x ]
stability: [ prefer-lowest, prefer-stable ]

name: Tests - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - SQLite

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

- name: Install dependencies
run: |
Expand All @@ -47,3 +193,18 @@ jobs:

- name: Execute tests
run: composer test

check:
if: always()
needs:
- static-analysis
- mysql
- postgres
- sqlite
runs-on: ubuntu-latest

steps:
- name: Check if all jobs are passing
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
<a href="https://packagist.org/packages/cachethq/core">
<img src="https://img.shields.io/packagist/v/cachethq/core" alt="Latest Stable Version">
</a>
<a href="https://packagist.org/packages/cachethq/core">
<img src="https://img.shields.io/github/license/cachethq/core" alt="License">
</a>
</p>

## Introduction
Expand All @@ -34,8 +31,7 @@ Cachet 3.x is currently in development and is not yet completely ready for produ
- [x] Incident Management
- [x] Incident Updates
- [x] Scheduled Maintenance
- [ ] Scheduled Maintenance Updates
- WIP - https://github.com/cachethq/core/pull/109
- [x] Scheduled Maintenance Updates
- [x] Components
- [ ] Metrics
- API and dashboard are working.
Expand Down Expand Up @@ -84,7 +80,7 @@ Login to the account at `/dashboard` and use credentials:
<p align="center">
<a href="https://jump24.co.uk"><img width="100px" src="https://github.com/jumptwentyfour.png" alt="Jump24"></a>
<a href="https://dreamtilt.com.au"><img width="100px" src="https://github.com/dreamtilt.png" alt="Dreamtilt"></a>
<a href="https://xyhen-it.nl"><img width="100px" src="https://github.com/xyphen-it.png" alt="Xyphen-IT"></a>
<a href="https://xyphen-it.nl"><img width="100px" src="https://github.com/xyphen-it.png" alt="Xyphen-IT"></a>
</p>

## Security Vulnerabilities
Expand Down
17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,28 @@
"require": {
"php": "^8.2",
"doctrine/dbal": "^3.6",
"filament/filament": "^3.2.23",
"filament/filament": "^3.2.57",
"filament/spatie-laravel-settings-plugin": "^3.2",
"guzzlehttp/guzzle": "^7.8",
"illuminate/console": "^11.0",
"illuminate/database": "^11.0",
"illuminate/events": "^11.0",
"illuminate/queue": "^11.0",
"illuminate/support": "^11.0",
"illuminate/console": "^11.23.0",
"illuminate/database": "^11.23.0",
"illuminate/events": "^11.23.0",
"illuminate/queue": "^11.23.0",
"illuminate/support": "^11.23.0",
"nesbot/carbon": "^2.70",
"spatie/laravel-data": "^4.11",
"spatie/laravel-query-builder": "^5.5",
"spatie/laravel-settings": "^3.2",
"timacdonald/json-api": "^v1.0.0-beta.4",
"twig/twig": "^3.0"
},
"require-dev": {
"larastan/larastan": "^3.0",
"laravel/pail": "^1.1",
"orchestra/testbench": "^9.5.1",
"pestphp/pest": "^3.2",
"pestphp/pest-plugin-laravel": "^3.0",
"pestphp/pest-plugin-livewire": "*",
"spatie/laravel-ray": "^1.32"
"pestphp/pest-plugin-livewire": "*"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion config/cachet.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
| This is the model that will be used to authenticate users. This model
| must be an instance of Illuminate\Foundation\Auth\User.
*/
'user_model' => App\Models\User::class,
'user_model' => \App\Models\User::class,

/*
|--------------------------------------------------------------------------
Expand Down
33 changes: 0 additions & 33 deletions database/factories/IncidentUpdateFactory.php

This file was deleted.

Loading

0 comments on commit 8cd20c6

Please sign in to comment.