Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

docs: Migration notice #3

docs: Migration notice

docs: Migration notice #3

Workflow file for this run

name: Code checks
on:
pull_request:
push:
branches:
- main
- develop
jobs:
tests:
runs-on: ubuntu-latest
services:
mysql-service:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: db_test
ports:
- 33306:3306
# Set health checks to wait until mysql database has started (it takes some seconds to start)
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Write ssh key to enable composer authentication for private packages
run: |
mkdir -p ~/.ssh
echo "${{ secrets.TEST_BACKEND_SSHKEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Copy environment variables
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Update .env file
run: |
echo "DB_CONNECTION=mysql" >> .env
echo "DB_HOST=127.0.0.1" >> .env
echo "DB_PORT=33306" >> .env
echo "DB_DATABASE=db_test" >> .env
echo "DB_USERNAME=root" >> .env
echo "DB_PASSWORD=password" >> .env
echo "APP_ENV=testing" >> .env
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysql, xml, ctype, iconv, json, pdo_mysql, tokenizer
coverage: xdebug
- name: Update Composer Dependencies
run: composer update -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Install dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Run tests
run: vendor/bin/testbench package:test
- name: Run linter test
run: composer pint:test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
verbose: true
- name: Clean up SSH key
if: always()
run: rm -f ~/.ssh/id_rsa