Skip to content

Run Tests

Run Tests #89

Workflow file for this run

name: "Run Tests"
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "app/**"
- "config/**"
- "database/**"
- "resources/**"
- "tests/**"
- ".env.example"
pull_request:
branches:
- master
paths:
- "app/**"
- "config/**"
- "database/**"
- "resources/**"
- "tests/**"
- ".env.example"
env:
XDEBUG_MODE: "coverage"
GITHUB_WORKSPACE: /var/www/html
APP_URL: http://localhost
APP_DOMAIN: localhost
ASSET_URL: http://localhost
SESSION_DOMAIN: .localhost
VITE_PUSHER_HOST: localhost
jobs:
testing:
runs-on: ubuntu-24.04
container:
image: ${{ vars.IMAGE }}:dev
options: --user root
credentials:
password: ${{ secrets.CR_PAT }}
username: ${{ secrets.REGISTRY_USERNAME }}
services:
pgsql:
image: "postgres:17-bookworm"
env:
PGPASSWORD: "dusan_malusev"
POSTGRES_DB: "testing"
POSTGRES_USER: "dusan_malusev"
POSTGRES_PASSWORD: "dusan_malusev"
redis:
image: "valkey/valkey:8-bookworm"
# meilisearch:
# image: "getmeili/meilisearch:latest"
# mailpit:
# image: "axllent/mailpit:latest"
# soketi:
# image: "quay.io/soketi/soketi:latest-16-alpine"
# env:
# SOKETI_DEBUG: "1"
# SOKETI_METRICS_SERVER_PORT: "9601"
# SOKETI_DB_REDIS_HOST: "redis"
# SOKETI_DB_REDIS_DB: "6"
# SOKETI_DEFAULT_APP_ID: "app-id"
# SOKETI_DEFAULT_APP_KEY: "app-key"
# SOKETI_DEFAULT_APP_SECRET: "app-secret"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Vendor
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ hashFiles('**/composer.lock') }}
- name: Cache Pint
uses: actions/cache@v4
with:
path: ./storage/pint.cache
key: ${{ runner.os }}-pint-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-pint-
- name: Cache Node Modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- name: Composer install
run: |
cp .env.example .env
composer install -q --no-ansi --prefer-dist --no-interaction --no-progress
php artisan key:generate
- name: Install Node Modules
run: |
npm install
npm run build
- name: Run unit tests
run: |
composer test:coverage:ci
npm ci
npm run test
env:
LARAVEL_BYPASS_ENV_CHECK: 1
- name: Run Pint
run: ./vendor/bin/pint
- uses: codecov/[email protected]
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.actor }}/website
name: website
fail_ci_if_error: false