update #71
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
name: CI | |
on: | |
push: | |
branches: | |
- "*" | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: [8.1,8.2,8.3] | |
laravel: [8.*,9.*,10.*,11.*] | |
name: running L-${{ matrix.laravel }} on PHP-${{ matrix.php }} | |
services: | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ROOT_USER: roo t | |
MYSQL_ROOT_PASSWORD: admin | |
MYSQL_DATABASE: fast_api_crud | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: intl, zip, pdo, pdo_mysql, pcntl, bcmath, gd, soap, xsl, xml, xmlrpc, mbstring, curl, json, dom, iconv, simplexml, xmlwriter, xmlreader, phar, posix, ctype, tokenizer, session, fileinfo, filter, hash, openssl, pcre, SPL, Reflection, calendar, exif, gettext, sockets, standard, date, libxml, zlib | |
coverage: none | |
- name: Get Composer Cache Directory and write to file | |
run: | | |
echo "$(composer config cache-files-dir)" > composer-cache-dir.txt | |
echo "COMPOSER_CACHE_DIR=$(cat composer-cache-dir.txt)" >> $GITHUB_ENV | |
- name: Cache Composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{ runner.os }}-composer-cache | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Setup cache path from file | |
run: | | |
echo "COMPOSER_CACHE_DIR=$(cat composer-cache-dir.txt)" >> $GITHUB_ENV | |
- name: Use cached directory in subsequent steps | |
run: | | |
# Use the COMPOSER_CACHE_DIR environment variable as needed here | |
echo "Cached Composer directory: $COMPOSER_CACHE_DIR" | |
- name: Install Composer dependencies | |
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | |
- name: Run php pest tests | |
run: vendor/bin/pest | |
env: | |
DB_CONNECTION: mysql | |
DB_HOST: 127.0.0.1 | |
DB_PORT: 3306 | |
DB_DATABASE: fast_api_crud | |
DB_USERNAME: root | |
DB_PASSWORD: admin |