Update Readme.md #7
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
| name: test | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| pull_request: | |
| branches: [ master, main ] | |
| jobs: | |
| phpunit: | |
| name: PHP ${{ matrix.php-versions }} | |
| runs-on: ubuntu-latest | |
| env: | |
| PHP_CS_FIXER_IGNORE_ENV: 1 | |
| services: | |
| mysql: | |
| image: mariadb:10.3 | |
| env: | |
| MYSQL_ROOT_PASSWORD: thelia | |
| MYSQL_DATABASE: thelia | |
| ports: | |
| - 3306/tcp | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-versions: ['8.1', '8.2'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Setup Environment | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install sendmail | |
| - name: Setup PHP, with composer and extensions | |
| uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| ini-values: post_max_size=20M | |
| extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql, gd, zip | |
| - name: Start mysql service | |
| run: sudo /etc/init.d/mysql start | |
| - name: Get composer cache directory | |
| id: composercache | |
| run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
| - name: Cache composer dependencies | |
| uses: actions/cache@v4 #https://github.com/actions/cache | |
| with: | |
| path: ${{ steps.composercache.outputs.dir }} | |
| # Use composer.json for key, if composer.lock is not committed. | |
| # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install Composer dependencies | |
| run: | | |
| composer install --no-progress --prefer-dist --optimize-autoloader | |
| composer update --no-interaction --prefer-dist | |
| - name: Install Thelia | |
| run: | | |
| php Thelia thelia:install --env=test --db_host=127.0.0.1:${{ job.services.mysql.ports['3306'] }} --db_username=root --db_name=thelia --db_password=thelia | |
| php Thelia module:refresh --env=test | |
| php Thelia admin:create --env=test --login_name thelia2 --password thelia2 --last_name thelia2 --first_name thelia2 --email thelia2@example.com | |
| - name: Run CI | |
| run: composer ci |