Skip to content

Commit 40d7f5d

Browse files
Upgrade PHPUnit workflow to latest dependencies
Updated MySQL to 8.0 and PHP to 8.2 for improved performance and compatibility. Also, upgraded various GitHub Actions to their latest versions to enhance security and functionality. Simplified dependency installation commands.
1 parent ed9693d commit 40d7f5d

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

.github/workflows/phpunit.yml

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,59 @@
11
name: Run tests
2-
32
on: [push, pull_request]
43

54
jobs:
65
run-tests:
76
name: Run tests
87
runs-on: ubuntu-latest
8+
99
services:
1010
mysql:
11-
image: mysql:5.7
11+
image: mysql:8.0
1212
env:
1313
MYSQL_ROOT_PASSWORD: password
1414
MYSQL_PASSWORD: password
1515
MYSQL_DATABASE: daybyday_test
1616
ports:
1717
- 3306:3306
1818
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
19+
1920
steps:
2021
- name: Checkout code
21-
uses: actions/checkout@v1
22+
uses: actions/checkout@v3
2223

2324
- name: Setup PHP
24-
uses: shivammathur/setup-php@v1
25+
uses: shivammathur/setup-php@v2
2526
with:
26-
php-version: '7.3'
27+
php-version: '8.2'
2728
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
28-
coverage: none
2929

3030
- name: Create daybyday testing database
3131
env:
3232
PORT: ${{ job.services.mysql.ports[3306] }}
3333
run: mysql -h 127.0.0.1 --port "$PORT" -u root -ppassword -e 'CREATE DATABASE IF NOT EXISTS daybyday_test;'
3434

35-
- name: Run yarn
36-
run: yarn && yarn dev
35+
- name: Install dependencies
36+
run: |
37+
yarn install
38+
yarn run dev
3739
38-
- name: Cache composer dependencies
39-
uses: actions/cache@v1
40+
- name: Cache Composer dependencies
41+
uses: actions/cache@v3
4042
with:
4143
path: vendor
42-
key: composer-${{ hashFiles('composer.lock') }}
44+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
45+
restore-keys: ${{ runner.os }}-composer-
4346

44-
- name: Run composer install
47+
- name: Run Composer install
4548
run: composer install --no-ansi --no-scripts --no-interaction --optimize-autoloader --prefer-dist
4649

47-
- name: Prepare Laravel Application
50+
- name: Prepare Laravel application
4851
run: |
4952
cp .env.ci .env
5053
php artisan key:generate
5154
5255
- name: Database setup
53-
run: php artisan migrate --seed
56+
run: php artisan migrate --seed
5457

5558
- name: Run tests
56-
run: ./vendor/bin/phpunit
57-
env:
58-
ELASTICSEARCH_PORT: ${{ job.services.elasticsearch.ports[9200] }}
59+
run: ./vendor/bin/phpunit

0 commit comments

Comments
 (0)