-
Notifications
You must be signed in to change notification settings - Fork 50
140 lines (114 loc) · 4.16 KB
/
continuous-integration-optional.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: CI (optional checks)
on:
push:
branches-ignore:
- gh-readonly-queue/**
pull_request:
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
api-validate-composer-lock:
name: 'Validate Api Platform composer.lock'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3.13'
tools: composer:2.8.0
coverage: xdebug
- run: composer validate -n --no-check-all --no-check-publish --strict
working-directory: api
api-psalm:
name: 'Lint: API (psalm)'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3.13'
tools: composer:2.8.0
coverage: xdebug
- name: Get Composer Cache Directory
id: composer-cache
run: 'echo "dir=$(composer config cache-files-dir)" | tr -d "\n" >> $GITHUB_OUTPUT'
working-directory: api
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- run: composer install --no-interaction --no-plugins --no-scripts --prefer-dist
working-directory: api
- run: composer psalm
working-directory: api
api-phpstan:
name: 'Lint: API (phpstan)'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3.13'
tools: composer:2.8.0
coverage: xdebug
- name: Get Composer Cache Directory
id: composer-cache
run: 'echo "dir=$(composer config cache-files-dir)" | tr -d "\n" >> $GITHUB_OUTPUT'
working-directory: api
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- run: composer install --no-interaction --no-plugins --no-scripts --prefer-dist
working-directory: api
- run: composer phpstan
working-directory: api
api-validate-migrations:
name: 'API: validate migrations'
runs-on: ubuntu-latest
env:
DATABASE_URL: postgresql://ecamp3:ecamp3@localhost:5432/ecamp3?serverVersion=15&charset=utf8
services:
postgres:
image: 'postgres:15-alpine'
env:
POSTGRES_DB: 'ecamp3test'
POSTGRES_PASSWORD: 'ecamp3'
POSTGRES_USER: 'ecamp3'
ports:
- '5432:5432'
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3.13'
tools: composer:2.8.0
coverage: xdebug
- name: Get Composer Cache Directory
id: composer-cache
run: 'echo "dir=$(composer config cache-files-dir)" | tr -d "\n" >> $GITHUB_OUTPUT'
working-directory: api
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- run: composer install --prefer-dist --no-progress --no-interaction
working-directory: api
- run: php bin/console doctrine:migrations:migrate --no-interaction -e test
working-directory: api
- run: php bin/console doctrine:schema:validate -v -e test
working-directory: api