-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (68 loc) · 2.13 KB
/
Copy pathdeploy-application.yml
File metadata and controls
80 lines (68 loc) · 2.13 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
name: Deploy Application
on:
push:
branches:
- '*'
jobs:
create-deployment-artifact:
name: Create Deployment Artifact
runs-on: ubuntu-latest
# The test suite runs on PostgreSQL, the same engine as production. The
# migrations use Postgres-native SQL, so SQLite cannot run them.
services:
postgres:
image: postgres:17.6-alpine
env:
POSTGRES_DB: memflash_test
POSTGRES_USER: memflash
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U memflash"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: composer
- name: Install PHP Dependencies
working-directory: ./
run: |
composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Compile CSS and JavaScript
working-directory: ./
run: |
npm ci
npm run build
- name: Setup Environment
working-directory: ./
run: |
cp .env.example .env
php artisan key:generate
# .env.example points DB_HOST at the compose service name; in CI the
# postgres service is reachable on localhost via the mapped port.
sed -i 's/^DB_HOST=.*/DB_HOST=127.0.0.1/' .env
- name: Run Pint Test
working-directory: ./
run: |
./vendor/bin/pint --test
- name: Run Pest Tests
working-directory: ./
run: |
./vendor/bin/pest
# The offline FSRS mirror and the PHP scheduler are checked against the same
# fixture. If they diverge the user is shown one interval and given another,
# so both suites have to run.
- name: Run JavaScript Tests
working-directory: ./
run: |
npm run test:js
- name: Run PHPStan Analysis
working-directory: ./
run: |
./vendor/bin/phpstan --memory-limit=2048M analyse