mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
106 lines
3.9 KiB
YAML
106 lines
3.9 KiB
YAML
name: Tests
|
||
|
||
on:
|
||
push:
|
||
branches:
|
||
- "**v5.x**"
|
||
|
||
permissions:
|
||
contents: read
|
||
|
||
concurrency:
|
||
group: tests-${{ github.ref }}
|
||
cancel-in-progress: true
|
||
|
||
jobs:
|
||
composer-validate:
|
||
name: Validate composer.json
|
||
runs-on: ubuntu-24.04 # https://github.com/actions/runner-images
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # https://github.com/actions/checkout/releases/tag/v6.0.2
|
||
with:
|
||
persist-credentials: false
|
||
|
||
- name: Setup PHP 8.5
|
||
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # https://github.com/shivammathur/setup-php/releases/tag/2.36.0
|
||
with:
|
||
php-version: "8.5.3" # https://github.com/php/php-src/releases/tag/php-8.5.3
|
||
|
||
- name: Validate composer.json
|
||
run: composer validate --check-lock --strict
|
||
|
||
composer-audit:
|
||
name: Composer Audit
|
||
runs-on: ubuntu-24.04 # https://github.com/actions/runner-images
|
||
needs: [composer-validate]
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # https://github.com/actions/checkout/releases/tag/v6.0.2
|
||
with:
|
||
persist-credentials: false
|
||
|
||
- name: Setup PHP 8.5
|
||
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # https://github.com/shivammathur/setup-php/releases/tag/2.36.0
|
||
with:
|
||
php-version: "8.5.3" # https://github.com/php/php-src/releases/tag/php-8.5.3
|
||
|
||
- name: Cache Composer packages
|
||
id: composer-cache
|
||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # https://github.com/actions/cache/releases/tag/v5.0.3
|
||
with:
|
||
path: /vendor
|
||
key: php-${{ hashFiles('composer.lock') }}
|
||
|
||
- name: Install PHP dependencies
|
||
if: steps.composer-cache.outputs.cache-hit != 'true'
|
||
run: composer install --no-progress --no-interaction
|
||
|
||
- name: Run Composer audit
|
||
run: composer audit --locked --abandoned=fail
|
||
|
||
bun-audit:
|
||
name: Bun Audit
|
||
runs-on: ubuntu-24.04 # https://github.com/actions/runner-images
|
||
needs: [composer-validate]
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # https://github.com/actions/checkout/releases/tag/v6.0.2
|
||
with:
|
||
persist-credentials: false
|
||
|
||
- name: Setup Bun
|
||
uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # https://github.com/oven-sh/setup-bun/releases/tag/v2.1.2
|
||
with:
|
||
bun-version: 1.3.9 # https://github.com/oven-sh/bun/releases/tag/bun-v1.3.9
|
||
- name: Run Bun audit
|
||
run: bun audit --frozen-lockfile
|
||
|
||
test:
|
||
name: Tests
|
||
runs-on: ubuntu-24.04 # https://github.com/actions/runner-images
|
||
needs: [composer-audit, bun-audit]
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # https://github.com/actions/checkout/releases/tag/v6.0.2
|
||
with:
|
||
persist-credentials: false
|
||
|
||
- name: Setup PHP 8.5 with Xdebug
|
||
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # https://github.com/shivammathur/setup-php/releases/tag/2.36.0
|
||
with:
|
||
php-version: "8.5.3" # https://github.com/php/php-src/releases/tag/php-8.5.3
|
||
coverage: xdebug-3.5.1 # https://github.com/xdebug/xdebug/releases/tag/3.5.1
|
||
- name: Cache Composer packages
|
||
id: composer-cache
|
||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # https://github.com/actions/cache/releases/tag/v5.0.3
|
||
with:
|
||
path: /vendor
|
||
key: php-${{ hashFiles('composer.lock') }}
|
||
|
||
- name: Install PHP dependencies
|
||
if: steps.composer-cache.outputs.cache-hit != 'true'
|
||
run: composer install --no-progress --no-interaction
|
||
|
||
- name: Run tests
|
||
run: composer test:all
|