-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (119 loc) · 4.99 KB
/
Copy pathmain.yml
File metadata and controls
155 lines (119 loc) · 4.99 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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Main Branch
on:
push:
branches: [ main ]
permissions:
contents: read
jobs:
quality-gate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: ctype, iconv, zip
coverage: xdebug
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-8.3-
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Run linting (Pint) - All Components
run: composer run lint
- name: Run PHPStan static analysis - All Components
run: composer run phpstan
- name: Run PHPUnit tests with coverage
run: composer run test-coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage/clover.xml
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Run security audit
run: composer audit
- name: Verify no uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes detected after running quality checks"
git status
exit 1
fi
component-tests:
runs-on: ubuntu-latest
needs: quality-gate
strategy:
matrix:
component: [ bundle, codegen, serialization, fhir-path ]
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: ctype, iconv, zip
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Run component-specific linting
run: composer run lint:${{ matrix.component }}
- name: Run component-specific PHPStan
run: composer run phpstan:${{ matrix.component }}
- name: Run component-specific tests
run: composer run test:${{ matrix.component }}
integration-test:
runs-on: ubuntu-latest
needs: [ quality-gate, component-tests ]
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: ctype, iconv, zip
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Install demo dependencies
run: composer install --working-dir=demo --prefer-dist --no-progress
- name: Run integration tests
run: composer run test-integration
- name: Run FHIRPath specification tests
run: composer run test-fhirpath-spec
- name: Test FHIR model generation
run: |
# Test that the generate command works
php demo/bin/console list | grep fhir:generate
echo "FHIR generation command is available"
- name: Test Symfony Flex recipe
run: composer run test-recipe
- name: Validate recipe configuration
run: composer run validate-recipe
cross-version-test:
runs-on: ubuntu-latest
needs: quality-gate
strategy:
matrix:
php-version: [ '8.3', '8.4' ]
symfony-version: [ '6.4.*', '7.4.*' ]
steps:
- uses: actions/checkout@v4
- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ctype, iconv, zip
- name: Install dependencies with Symfony ${{ matrix.symfony-version }}
run: |
composer require --dev symfony/framework-bundle:${{ matrix.symfony-version }} --no-update
composer install --prefer-dist --no-progress --no-suggest
- name: Run component tests
run: composer run test:components
- name: Test bundle integration
run: composer run test:bundle