ci.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. name: UNA CI
  2. on:
  3. push:
  4. branches: [ "master" ]
  5. pull_request:
  6. branches: [ "master" ]
  7. permissions:
  8. contents: read
  9. jobs:
  10. test:
  11. runs-on: ubuntu-latest
  12. services:
  13. mysql:
  14. image: mariadb:11
  15. env:
  16. MYSQL_ROOT_PASSWORD: root
  17. MYSQL_DATABASE: una
  18. MYSQL_USER: una
  19. MYSQL_PASSWORD: una
  20. ports:
  21. - 3306:3306
  22. options: >-
  23. --health-cmd="healthcheck.sh --connect --innodb_initialized"
  24. --health-interval=10s
  25. --health-timeout=5s
  26. --health-retries=10
  27. steps:
  28. - uses: actions/checkout@v4
  29. - name: Setup PHP
  30. uses: shivammathur/setup-php@v2
  31. with:
  32. php-version: '8.3'
  33. extensions: intl, curl, gd, mbstring, zip, exif, pdo_mysql
  34. ini-values: short_open_tag=On, memory_limit=256M
  35. tools: composer
  36. - name: Setup Node
  37. uses: actions/setup-node@v4
  38. with:
  39. node-version: '24'
  40. cache: yarn
  41. - name: Install PHP dependencies
  42. run: composer install --prefer-dist --no-progress
  43. - name: Install JS dependencies
  44. run: yarn install --frozen-lockfile
  45. - name: Prepare writable paths
  46. run: |
  47. mkdir -p cache cache_public logs tmp storage
  48. chmod -R a+rwX inc cache cache_public logs tmp storage
  49. test -f plugins/ffmpeg/ffmpeg.exe && chmod 0755 plugins/ffmpeg/ffmpeg.exe
  50. - name: Install UNA
  51. working-directory: install
  52. run: >
  53. php cmd.php
  54. -m bx_antispam
  55. --db_host=127.0.0.1
  56. --db_name=una
  57. --db_user=una
  58. --db_password=una
  59. --server_http_host=localhost
  60. --server_php_self=/install/index.php
  61. - name: Run PHPUnit
  62. run: composer test