Run Tests #93
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
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.build .env | |
composer install --no-ansi --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 |