Skip to content

Merge branch 'main' of https://github.com/inikoo/aiku into main #3809

Merge branch 'main' of https://github.com/inikoo/aiku into main

Merge branch 'main' of https://github.com/inikoo/aiku into main #3809

Workflow file for this run

name: Backend Tests
on:
push:
branches: [ "main" ]
env:
HOME: /home/aiku
XDEBUG_MODE: coverage
jobs:
laravel-tests:
name: Run backend tests 🧪
runs-on: [ cloud ]
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Composer install
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Prepare environment
run: |
ln -s ../../../../.pgpass .pgpass
ln -s ../../../../env.aiku.testing .env.testing
ln -s ../../../../env.aiku.testing .env
ln -s ../../../../../artifacts/public/grp public/grp
ln -s ../../../../../artifacts/public/iris public/iris
ln -s ../../../../../artifacts/public/retina public/retina
ln -s ../../../../../artifacts/public/aiku-public public/aiku-public
mkdir private
cd private
ln -s ../../../../../artifacts/fa .
- name: Get db changed files
id: changed-db-files
uses: tj-actions/changed-files@v44
with:
files: |
app/Enums/**
app/Stubs/**
database/migrations/**
- name: Get coverage changed files
id: changed-coverage-files
uses: tj-actions/changed-files@v44
with:
files: |
app/**
tests/**
database/migrations/**
- name: Generate database dumps 📚
run: ./generate_testing_db_dumps.sh php8.3 aiku;cp tests/datasets/db_dumps/aiku.dump ../../../../artifacts/
- name: Retrieve db dumps
run: cp ../../../../artifacts/aiku.dump tests/datasets/db_dumps/
- name: Run test with coverage
if: steps.changed-coverage-files.outputs.any_changed == 'true'
run: vendor/bin/pest -d memory_limit=-1 --coverage-clover clover.xml --exclude-group=aurora-fetch,integration --stop-on-defect
- name: Run test without coverage
if: steps.changed-coverage-files.outputs.any_changed != 'true'
run: vendor/bin/pest --exclude-group=aurora-fetch,integration --stop-on-defect
- name: Upload coverage to Codecov
if: steps.changed-coverage-files.outputs.any_changed == 'true'
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
file: ./clover.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true