Implement FullRescanMessage and its handler; refactor SyncController … #1107
This file contains hidden or 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
# GitHub Action for Symfony | |
name: UDOIT | |
on: [push, pull_request] | |
jobs: | |
symfony: | |
name: UDOIT (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}) | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
fail-fast: false | |
matrix: | |
operating-system: [ubuntu-latest] | |
php-versions: ['8.4'] | |
node-version: [16.19.0] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Check PHP syntax errors | |
uses: overtrue/[email protected] | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Setup PHP, with composer and extensions | |
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, gd, pdo_mysql, pdo_pgsql | |
coverage: xdebug #optional | |
- name: Get composer cache directory | |
id: get-composer-cache-dir | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer dependencies | |
id: composer-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
vendor | |
${{ steps.get-composer-cache-dir.outputs.dir }} | |
key: php-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: php-${{ matrix.php-versions }}-composer- | |
- name: Check if composer cache was found | |
run: echo "Cache hit ${{ steps.composer-cache.outputs.cache-hit }}" | |
- name: Create .env file | |
run: cp .env.example .env | |
- name: Install Composer dependencies | |
if: ${{ steps.composer-cache.outputs.cache-hit != 'true' }} | |
run: composer install --no-progress --prefer-dist --optimize-autoloader | |
- name: PHPUnit Testing | |
run: SYMFONY_DEPRECATIONS_HELPER=disabled ./vendor/bin/phpunit | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: | | |
echo "Yarn cache directory:" | |
yarn config get cacheFolder | |
echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
- name: Cache Yarn dependencies | |
uses: actions/cache@v4 | |
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: php-${{ matrix.php-versions }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
php-${{ matrix.php-versions }}-yarn- | |
- name: Install Yarn dependencies | |
if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }} | |
run: yarn install | |
- name: Yarn build | |
run: yarn build | |
- name: Yarn test | |
run: yarn test | |
- name: Verify if cache was found | |
run: echo "Cache hit ${{ steps.yarn-cache.outputs.cache-hit }}" | |
- name: Start and initialize Postgres | |
env: | |
DATABASE_URL: postgresql://udoit:[email protected]:5432/udoit?serverVersion=11&charset=utf8 | |
run: | | |
sudo systemctl start postgresql.service | |
sudo -u postgres psql -c "CREATE DATABASE udoit;" | |
sudo -u postgres psql -c "CREATE USER udoit WITH PASSWORD 'udoit';" | |
sudo -u postgres psql -c "ALTER USER udoit WITH SUPERUSER;" | |
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE "udoit" TO udoit;" | |
php bin/console doctrine:migrations:migrate | |
- name: Create and populate MySQL database | |
env: | |
DATABASE_URL: mysql://root:root@localhost/udoit | |
run: | | |
sudo systemctl start mysql.service | |
php bin/console doctrine:database:create | |
php bin/console doctrine:migrations:migrate |