-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (101 loc) · 2.85 KB
/
link-analyse-test.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# .github/workflows/link-analyse-test.yml
name: Lint, Analyse and Test
on:
pull_request:
paths:
- ".github/**"
- "src/**"
branches:
- main
push:
paths:
- ".github/**"
- "src/**"
branches:
- main
jobs:
Lint:
name: Lint ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["8.1", "8.2"]
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- uses: actions/checkout@v3
name: Checkout branch
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: laravel/pint, overtrue/phplint
- name: Outupt PHP version
run: php --version
- name: Check PHP syntax
run: phplint --exclude=*.log .
working-directory: src
- name: Run Laravel Pint
run: pint --test
working-directory: src
Test:
name: Run tests ${{ matrix.php-version }}
runs-on: ubuntu-latest
needs:
- Lint
strategy:
matrix:
php-version: [ "8.2" ]
services:
postgres:
image: postgres
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- uses: actions/checkout@v3
name: Checkout branch
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: laravel/pint, overtrue/phplint
- name: Outupt PHP version
run: php --version
- name: Check PHP syntax
run: phplint --exclude=*.log .
working-directory: src
- name: Run Laravel Pint
run: pint --test
working-directory: src
- name: Install composer
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
run: composer install --optimize-autoloader --no-progress --no-interaction --ignore-platform-req=php
working-directory: src
- name: Run PHPstan
run: ./vendor/bin/phpstan analyse
working-directory: src
- name: Setup environment variables
run: |
cp .env.ci .env
cp .env.ci .env.testing
working-directory: src
- name: Install NPM Packages
run: |
npm install
npm run build
working-directory: src
- name: Run tests
run: ./vendor/bin/pest
working-directory: src