-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (63 loc) · 1.93 KB
/
code-checks.yaml
File metadata and controls
67 lines (63 loc) · 1.93 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
name: Code Checks
on:
push:
branches: [
"main",
"dev*"
]
pull_request:
branches: [
"main",
"dev*",
]
jobs:
laravel-tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
# The MySQL docker container requires these environment variables to be set
# so we can create and migrate the test database.
# See: https://hub.docker.com/_/mysql
MYSQL_DATABASE: testdb
MYSQL_ROOT_PASSWORD: testrootpass
ports:
# Opens port 3306 on service container and host
# https://docs.github.com/en/actions/using-containerized-services/about-service-containers
- 3306:3306
steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.3'
- uses: actions/checkout@v4
- name: Copy code .env
working-directory: ./code
run: cp .env.example .env
- name: Install Dependencies
working-directory: ./code
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate app key
working-directory: ./code
run: php artisan key:generate
- name: Generate jwt key
working-directory: ./code
run: php artisan jwt:secret -f
- name: Directory Permissions
working-directory: ./code
run: chmod -R 777 storage bootstrap/cache
- name: Debug Config
working-directory: ./code
run: php artisan config:show database
env:
TEST_DB_DATABASE: "testdb"
TEST_DB_USERNAME: "root"
TEST_DB_PASSWORD: "testrootpass"
- name: Run tests
working-directory: ./code
run: php artisan test
env:
TEST_DB_HOST: "127.0.0.1"
TEST_DB_DATABASE: "testdb"
TEST_DB_USERNAME: "root"
TEST_DB_PASSWORD: "testrootpass"