-
Notifications
You must be signed in to change notification settings - Fork 20
77 lines (72 loc) · 2.16 KB
/
github-ci.yml
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
name: HorizontCMS CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: php-actions/composer@v6
with:
args: --ignore-platform-reqs
- name: Check PHP syntax errors
uses: overtrue/[email protected]
test:
runs-on: ubuntu-latest
env:
DB_HOST: localhost
DB_CONNECTION: mysql
DB_DATABASE: horizontlaravel
DB_USERNAME: root
DB_PASSWORD: password
LOG_CHANNEL: stderr
services:
mysql:
image: mysql:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: horizontlaravel
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v3
- uses: php-actions/composer@v6
with:
args: --ignore-platform-reqs
- name: Set up before tests
run: |
php artisan migrate --no-interaction --force
php artisan db:seed --no-interaction --force
- name: Force installed variable
run: export INSTALLED=YES
- name: Run unit tests
run: INSTALLED=YES XDEBUG_MODE=coverage vendor/bin/phpunit --testsuite Unit,Integration --coverage-clover reports/coverage.xml
- name: After test steps
run: |
if [ -f "reports/coverage.xml" ]; then vendor/bin/codacycoverage clover reports/coverage.xml; fi
php artisan --version
php artisan hcms:version
strategy:
fail-fast: false
matrix:
php-versions: ['8.1', '8.2']
docker_image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ttimot24/horizont-cms:latest