Skip to content

Commit 171f3d8

Browse files
committed
Initial import
1 parent 1ec8a87 commit 171f3d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1886
-5
lines changed

.gitattributes

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/.github/ export-ignore
2+
/.phpunit.cache/ export-ignore
3+
/resources/specifications/ export-ignore
4+
/tools/ export-ignore
5+
/tests/bootstrap.php export-ignore
6+
/tests/resources/xml export-ignore
7+
/tests/Utils/ export-ignore
8+
/tests/Addressing/ export-ignore
9+
codecov.yml export-ignore
10+
.editorconfig export-ignore
11+
.gitattributes export-ignore
12+
.gitignore export-ignore
13+
phpstan-baseline.neon export-ignore
14+
phpstan-baseline-dev.neon export-ignore
15+
phpstan.neon export-ignore
16+
phpstan-dev.neon export-ignore
17+
phpcs.xml export-ignore
18+
phpunit.xml export-ignore
19+
.php_cs.dist export-ignore
20+
.markdownlintignore export-ignore
21+
.markdownlint.yml export-ignore

.github/dependabot.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
3+
# To get started with Dependabot version updates, you'll need to specify which
4+
# package ecosystems to update and where the package manifests are located.
5+
# Please see the documentation for all configuration options:
6+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
7+
8+
version: 2
9+
updates:
10+
- package-ecosystem: "github-actions" # See documentation for possible values
11+
directory: "/" # Location of package manifests
12+
schedule:
13+
interval: "weekly"
14+
groups:
15+
all-actions:
16+
patterns: ["*"]
17+
18+
- package-ecosystem: "composer" # See documentation for possible values
19+
directory: "/" # Location of package manifests
20+
schedule:
21+
interval: "daily"
22+
ignore:
23+
- dependency-name: "*"
24+
update-types: ["version-update:semver-major"]
25+
groups:
26+
production-dependencies:
27+
dependency-type: "production"
28+
dev-dependencies:
29+
dependency-type: "development"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
3+
name: 'Lock Threads'
4+
5+
on: # yamllint disable-line rule:truthy
6+
schedule:
7+
- cron: '0 0 * * *'
8+
workflow_dispatch:
9+
10+
permissions:
11+
issues: write
12+
pull-requests: write
13+
14+
concurrency:
15+
group: lock
16+
17+
jobs:
18+
action:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: dessant/lock-threads@v6
22+
with:
23+
issue-inactive-days: '90'
24+
pr-inactive-days: '90'
25+
log-output: true
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
3+
name: Documentation
4+
5+
on: # yamllint disable-line rule:truthy
6+
push:
7+
branches: [master, release-*]
8+
paths:
9+
- '**.md'
10+
pull_request:
11+
branches: [master, release-*]
12+
paths:
13+
- '**.md'
14+
workflow_dispatch:
15+
16+
jobs:
17+
quality:
18+
name: Quality checks
19+
runs-on: [ubuntu-latest]
20+
21+
steps:
22+
- uses: actions/checkout@v6
23+
24+
- name: Lint markdown files
25+
uses: nosborn/github-action-markdown-cli@v3
26+
with:
27+
files: .
28+
ignore_path: .markdownlintignore
29+
30+
- name: Perform spell check
31+
uses: codespell-project/actions-codespell@v2
32+
with:
33+
path: '**/*.md'
34+
check_filenames: true
35+
ignore_words_list: tekst

.github/workflows/php.yml

Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,281 @@
1+
---
2+
3+
name: CI
4+
5+
on: # yamllint disable-line rule:truthy
6+
push:
7+
branches: ['**']
8+
paths-ignore:
9+
- '**.md'
10+
pull_request:
11+
branches: [master, release-*]
12+
paths-ignore:
13+
- '**.md'
14+
workflow_dispatch:
15+
16+
jobs:
17+
phplinter:
18+
name: 'PHP-Linter'
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
php-version: ['8.3', '8.4', '8.5']
23+
24+
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/[email protected]
25+
with:
26+
php-version: ${{ matrix.php-version }}
27+
28+
linter:
29+
name: 'Linter'
30+
strategy:
31+
fail-fast: false
32+
33+
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/[email protected]
34+
with:
35+
enable_eslinter: false
36+
enable_jsonlinter: true
37+
enable_stylelinter: false
38+
enable_yamllinter: true
39+
40+
unit-tests-linux:
41+
name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
42+
runs-on: ${{ matrix.operating-system }}
43+
needs: [phplinter, linter]
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
operating-system: [ubuntu-latest]
48+
php-versions: ['8.3', '8.4', '8.5']
49+
50+
steps:
51+
- name: Setup PHP, with composer and extensions
52+
# https://github.com/shivammathur/setup-php
53+
uses: shivammathur/setup-php@v2
54+
with:
55+
php-version: ${{ matrix.php-versions }}
56+
extensions: ctype, date, dom, intl, pcre, sodium, spl, xml
57+
tools: composer
58+
ini-values: error_reporting=E_ALL
59+
coverage: pcov
60+
61+
- name: Setup problem matchers for PHP
62+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
63+
64+
- name: Setup problem matchers for PHPUnit
65+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
66+
67+
- name: Set git to use LF
68+
run: |
69+
git config --global core.autocrlf false
70+
git config --global core.eol lf
71+
72+
- uses: actions/checkout@v6
73+
74+
- name: Get composer cache directory
75+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
76+
77+
- name: Cache composer dependencies
78+
uses: actions/cache@v5
79+
with:
80+
path: ${{ env.COMPOSER_CACHE }}
81+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
82+
restore-keys: ${{ runner.os }}-composer-
83+
84+
- name: Install Composer dependencies
85+
run: composer install --no-progress --prefer-dist --optimize-autoloader
86+
87+
- name: Run unit tests with coverage
88+
if: ${{ matrix.php-versions == '8.5' }}
89+
run: vendor/bin/phpunit
90+
91+
- name: Run unit tests (no coverage)
92+
if: ${{ matrix.php-versions != '8.5' }}
93+
run: vendor/bin/phpunit --no-coverage
94+
95+
- name: Save coverage data
96+
if: ${{ matrix.php-versions == '8.5' }}
97+
uses: actions/upload-artifact@v6
98+
with:
99+
name: coverage-data
100+
path: ${{ github.workspace }}/build
101+
102+
unit-tests-windows:
103+
name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
104+
runs-on: ${{ matrix.operating-system }}
105+
needs: [phplinter, linter]
106+
strategy:
107+
fail-fast: true
108+
matrix:
109+
operating-system: [windows-latest]
110+
php-versions: ['8.3', '8.4', '8.5']
111+
112+
steps:
113+
- name: Setup PHP, with composer and extensions
114+
# https://github.com/shivammathur/setup-php
115+
uses: shivammathur/setup-php@v2
116+
with:
117+
php-version: ${{ matrix.php-versions }}
118+
extensions: ctype, date, dom, intl, pcre, sodium, spl, xml
119+
tools: composer
120+
ini-values: error_reporting=E_ALL
121+
coverage: none
122+
123+
- name: Setup problem matchers for PHP
124+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
125+
126+
- name: Setup problem matchers for PHPUnit
127+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
128+
129+
- name: Set git to use LF
130+
run: |
131+
git config --global core.autocrlf false
132+
git config --global core.eol lf
133+
134+
- uses: actions/checkout@v6
135+
136+
- name: Get composer cache directory
137+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV"
138+
139+
- name: Cache composer dependencies
140+
uses: actions/cache@v5
141+
with:
142+
path: ${{ env.COMPOSER_CACHE }}
143+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
144+
restore-keys: ${{ runner.os }}-composer-
145+
146+
- name: Install Composer dependencies
147+
run: composer install --no-progress --prefer-dist --optimize-autoloader
148+
149+
- name: Run unit tests
150+
run: vendor/bin/phpunit --no-coverage
151+
152+
security:
153+
name: Security checks
154+
needs: [unit-tests-linux]
155+
runs-on: [ubuntu-latest]
156+
157+
steps:
158+
- name: Setup PHP, with composer and extensions
159+
# https://github.com/shivammathur/setup-php
160+
uses: shivammathur/setup-php@v2
161+
with:
162+
# Should be the lowest supported version
163+
php-version: '8.3'
164+
extensions: ctype, date, dom, intl, pcre, sodium, spl, xml
165+
tools: composer
166+
coverage: none
167+
168+
- name: Setup problem matchers for PHP
169+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
170+
171+
- uses: actions/checkout@v6
172+
173+
- name: Get composer cache directory
174+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
175+
176+
- name: Cache composer dependencies
177+
uses: actions/cache@v5
178+
with:
179+
path: ${{ env.COMPOSER_CACHE }}
180+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
181+
restore-keys: ${{ runner.os }}-composer-
182+
183+
- name: Install Composer dependencies
184+
run: composer install --no-progress --prefer-dist --optimize-autoloader
185+
186+
- name: Security check for locked dependencies
187+
run: composer audit
188+
189+
- name: Update Composer dependencies
190+
run: composer update --no-progress --prefer-dist --optimize-autoloader
191+
192+
- name: Security check for updated dependencies
193+
run: composer audit
194+
195+
quality:
196+
name: Quality control
197+
needs: [unit-tests-linux]
198+
runs-on: [ubuntu-latest]
199+
200+
steps:
201+
- name: Setup PHP, with composer and extensions
202+
id: setup-php
203+
# https://github.com/shivammathur/setup-php
204+
uses: shivammathur/setup-php@v2
205+
with:
206+
# Should be the higest supported version, so we can use the newest tools
207+
php-version: '8.5'
208+
tools: composer, composer-require-checker, composer-unused, phpcs
209+
extensions: ctype, date, dom, pcre, spl, xml
210+
211+
- name: Setup problem matchers for PHP
212+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
213+
214+
- uses: actions/checkout@v6
215+
216+
- name: Get composer cache directory
217+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
218+
219+
- name: Cache composer dependencies
220+
uses: actions/cache@v5
221+
with:
222+
path: ${{ env.COMPOSER_CACHE }}
223+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
224+
restore-keys: ${{ runner.os }}-composer-
225+
226+
- name: Validate composer.json and composer.lock
227+
run: composer validate
228+
229+
- name: Install Composer dependencies
230+
run: composer install --no-progress --prefer-dist --optimize-autoloader
231+
232+
- name: Check code for hard dependencies missing in composer.json
233+
run: composer-require-checker check composer.json
234+
235+
- name: Check code for unused dependencies in composer.json
236+
run: composer-unused
237+
238+
- name: PHP Code Sniffer
239+
run: vendor/bin/phpcs
240+
241+
- name: PHPStan
242+
run: |
243+
vendor/bin/phpstan analyze -c phpstan.neon
244+
245+
- name: PHPStan (testsuite)
246+
run: |
247+
vendor/bin/phpstan analyze -c phpstan-dev.neon
248+
249+
coverage:
250+
name: Code coverage
251+
runs-on: [ubuntu-latest]
252+
needs: [unit-tests-linux]
253+
254+
steps:
255+
- uses: actions/checkout@v6
256+
257+
- uses: actions/download-artifact@v7
258+
with:
259+
name: coverage-data
260+
path: ${{ github.workspace }}/build
261+
262+
- name: Codecov
263+
uses: codecov/codecov-action@v5
264+
with:
265+
token: ${{ secrets.CODECOV_TOKEN }}
266+
fail_ci_if_error: true
267+
verbose: true
268+
269+
cleanup:
270+
name: Cleanup artifacts
271+
needs: [unit-tests-linux, coverage]
272+
runs-on: [ubuntu-latest]
273+
if: |
274+
always() &&
275+
needs.coverage.result == 'success' ||
276+
(needs.unit-tests-linux.result == 'success' && needs.coverage.result == 'skipped')
277+
278+
steps:
279+
- uses: geekyeggo/delete-artifact@v5
280+
with:
281+
name: coverage-data

0 commit comments

Comments
 (0)