forked from cbdb-project/cbdb-online-main-server
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (69 loc) · 2.09 KB
/
Copy pathphpunit.yml
File metadata and controls
85 lines (69 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: PHPUnit Tests
on:
push:
branches:
- main
- develop
- feature/**
- claude/**
- fix/**
pull_request:
branches:
- main
- develop
permissions:
contents: read
jobs:
feature-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mbstring, xml, ctype, iconv, curl, pdo_sqlite
coverage: none
# PHP 8.4 經測試可正常運行,建議使用以獲得最佳性能
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v6
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: '22'
- name: Get npm cache directory
id: npm-cache
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: Cache npm dependencies
uses: actions/cache@v6
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-
- name: Build frontend assets
run: |
npm install
npm run prod
- name: Run frontend unit tests (vitest)
run: npm run test
- name: Display versions
run: |
php -v
composer --version
./vendor/bin/phpunit --version
- name: Prepare environment
run: |
cp .env.example .env
php artisan key:generate
- name: Run PHPUnit suite
run: ./vendor/bin/phpunit