Merge pull request #2138 from Civolilah/bugfix/1754-negative-invoice #3010
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
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- develop | |
name: playwright | |
jobs: | |
run: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: ['ubuntu-latest'] | |
php-versions: ['8.2'] | |
phpunit-versions: ['latest'] | |
laravel: [10.*] | |
dependency-version: [prefer-stable] | |
env: | |
DB_CONNECTION: mysql | |
DB_DATABASE1: ninja | |
DB_USERNAME1: root | |
DB_PASSWORD1: ninja | |
DB_HOST1: '127.0.0.1' | |
DB_DATABASE: ninja | |
DB_USERNAME: root | |
DB_PASSWORD: ninja | |
DB_HOST: '127.0.0.1' | |
REDIS_PORT: 6379 | |
BROADCAST_DRIVER: log | |
CACHE_DRIVER: redis | |
QUEUE_CONNECTION: redis | |
SESSION_DRIVER: redis | |
NINJA_ENVIRONMENT: hosted | |
MULTI_DB_ENABLED: false | |
NINJA_LICENSE: ${{ secrets.ninja_license }} | |
TRAVIS: true | |
MAIL_MAILER: log | |
VITE_IS_TEST: true | |
VITE_ROUTER: browser | |
VITE_API_URL: http://ninja.test:8000 | |
services: | |
mariadb: | |
image: mariadb:10.6 | |
ports: | |
- 32768:3306 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
MYSQL_USER: ninja | |
MYSQL_PASSWORD: ninja | |
MYSQL_DATABASE: ninja | |
MYSQL_ROOT_PASSWORD: ninja | |
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 | |
redis: | |
image: redis | |
ports: | |
- 6379/tcp | |
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Add hosts to /etc/hosts | |
run: | | |
sudo echo "127.0.0.1 ninja.test" | sudo tee -a /etc/hosts | |
- name: Install Apache | |
run: sudo apt-get update && sudo apt-get install -y apache2 | |
- name: Start Apache | |
run: sudo service apache2 start | |
- name: Start MariaDB service | |
run: | | |
sudo systemctl start mysql.service | |
- name: Verify MariaDB connection | |
env: | |
DB_PORT: ${{ job.services.mariadb.ports[3306] }} | |
DB_PORT1: ${{ job.services.mariadb.ports[3306] }} | |
run: | | |
while ! mysqladmin ping -h"127.0.0.1" -P"$DB_PORT" --silent; do | |
sleep 1 | |
done | |
- name: Setup PHP shivammathur/setup-php@v2 | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: mysql, mysqlnd, sqlite3, bcmath, gmp, gd, curl, zip, openssl, mbstring, xml, redis | |
- name: Build ninja | |
run: | | |
git clone --depth 1 https://${{secrets.commit_secret}}@github.com/invoiceninja/invoiceninja.git -b v5-develop | |
cd invoiceninja | |
composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} | |
composer install | |
cp .env.ci .env | |
- name: Prepare Laravel Application | |
env: | |
REDIS_PORT: ${{ job.services.redis.ports['6379'] }} | |
run: | | |
cd invoiceninja | |
php artisan key:generate | |
php artisan config:clear | |
php artisan ninja:post-update | |
php artisan optimize | |
vendor/bin/snappdf download | |
sudo find ./vendor/bin/ -type f -exec chmod +x {} \; | |
sudo find ./ -type d -exec chmod 755 {} \; | |
php artisan migrate:fresh --seed | |
php artisan db:seed --class=RandomDataSeeder | |
php artisan serve --port=8000 & | |
- name: Prepare React FrontEnd | |
run: | | |
git clone https://${{secrets.commit_secret}}@github.com/invoiceninja/ui.git | |
cd ui | |
git checkout develop | |
cp .env.example .env | |
npm ci | |
npx playwright install --with-deps | |
npm run build | |
npx playwright test --workers=1 --reporter=list --max-failures=1 | |
env: | |
VITE_API_URL: http://ninja.test:8000 | |
PLAYWRIGHT_BASE_URL: http://localhost:4173 | |
PLAYWRIGHT_TEST_BASE_URL: http://localhost:4173 | |
VITE_IS_TEST: true | |
VITE_ROUTER: browser | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 |