Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit ed68d28

Browse files
Initial public commit
Co-authored-by: James Collins <james@om4.com.au>
1 parent 25cc98c commit ed68d28

File tree

128 files changed

+12533
-70
lines changed

Some content is hidden

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

128 files changed

+12533
-70
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.gitattributes export-ignore
2+
.github/ export-ignore
3+
.gitignore export-ignore
4+
artifacts/ export-ignore
5+
manifest.json export-ignore

.github/workflows/ci.yml

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
2+
3+
on:
4+
# Run on every commit.
5+
- push
6+
# Allow manually triggering the workflow.
7+
- workflow_dispatch
8+
9+
# Cancels all previous workflow runs for the same branch that have not yet completed.
10+
concurrency:
11+
# The concurrency group contains the workflow name and the branch name.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
name: CI
16+
17+
jobs:
18+
static-analysis:
19+
name: Static Analysis
20+
21+
timeout-minutes: 5
22+
23+
runs-on: ubuntu-latest
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
test-type: [phpcs, phpstan]
29+
30+
env:
31+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
37+
- name: Setup PHP
38+
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: 8.1
41+
# Colon means remove
42+
extensions: :apcu, :imagick
43+
coverage: none
44+
tools: none
45+
env:
46+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Install composer dependencies
49+
run: composer update --no-interaction --no-ansi --no-progress --optimize-autoloader
50+
51+
- name: Test with ${{ matrix.test-type }}
52+
run: composer test:${{ matrix.test-type }}
53+
54+
tests:
55+
name: Tests
56+
57+
timeout-minutes: 5
58+
59+
needs: static-analysis
60+
61+
runs-on: ${{ matrix.os }}
62+
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
os: [macos-latest, ubuntu-latest, windows-latest]
67+
test-type: [unit, integration]
68+
php-version: ['7.2', '7.3', '7.4', '8.0', '8.1']
69+
dependencies: [lowest, highest]
70+
exclude:
71+
- test-type: unit
72+
dependencies: lowest
73+
os: macos-latest
74+
- test-type: unit
75+
dependencies: lowest
76+
os: windows-latest
77+
- test-type: integration
78+
os: macos-latest
79+
- test-type: integration
80+
os: windows-latest
81+
82+
env:
83+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
84+
85+
steps:
86+
- name: Checkout
87+
uses: actions/checkout@v2
88+
89+
- name: Setup node
90+
if: matrix.test-type == 'integration'
91+
uses: actions/setup-node@v2
92+
with:
93+
node-version: '16'
94+
95+
- name: Install and run @stoplight/prism
96+
if: matrix.test-type == 'integration'
97+
run: |
98+
npm install -g @stoplight/prism-cli
99+
prism mock tests/openapi.yaml >artifacts/prism.log 2>&1 &
100+
101+
- name: Setup PHP
102+
uses: shivammathur/setup-php@v2
103+
with:
104+
php-version: ${{ matrix.php-version }}
105+
coverage: none
106+
extensions: ctype, json, mbstring, simplexml, tokenizer, xmlwriter, :apcu, :imagick
107+
ini-values: memory_limit=-1, assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
108+
tools: none
109+
110+
- name: Install lowest dependencies with composer
111+
if: matrix.dependencies == 'lowest'
112+
run: composer update --no-interaction --no-ansi --no-progress --prefer-lowest --optimize-autoloader
113+
114+
- name: Install highest dependencies with composer
115+
if: matrix.dependencies == 'highest'
116+
run: composer update --no-interaction --no-ansi --no-progress --optimize-autoloader
117+
118+
- name: Test ${{ matrix.test-type }} with phpunit
119+
run: composer test:${{ matrix.test-type }} -- --testdox
120+
121+
- name: Upload prism log
122+
if: matrix.test-type == 'integration'
123+
uses: actions/upload-artifact@v3
124+
with:
125+
name: ${{ github.event.repository.name }}-prism.log
126+
path: artifacts/prism.log
127+
128+
coverage:
129+
name: Coverage
130+
131+
timeout-minutes: 5
132+
133+
needs: tests
134+
135+
runs-on: ubuntu-latest
136+
137+
env:
138+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
139+
140+
steps:
141+
- name: Checkout
142+
uses: actions/checkout@v2
143+
144+
- name: Setup node
145+
uses: actions/setup-node@v2
146+
with:
147+
node-version: '16'
148+
149+
- name: Install and run @stoplight/prism
150+
run: |
151+
npm install -g @stoplight/prism-cli
152+
prism mock tests/openapi.yaml &
153+
154+
- name: Setup PHP
155+
uses: shivammathur/setup-php@v2
156+
with:
157+
php-version: 8.1
158+
coverage: xdebug
159+
extensions: ctype, json, mbstring, simplexml, tokenizer, xmlwriter, :apcu, :imagick
160+
ini-values: memory_limit=-1, assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
161+
tools: none
162+
163+
- name: Install composer dependencies
164+
run: composer update --no-interaction --no-ansi --no-progress --optimize-autoloader
165+
166+
- name: Test coverage with phpunit
167+
run: composer test:coverage
168+
169+
- name: Upload code coverage results
170+
uses: actions/upload-artifact@v3
171+
with:
172+
name: ${{ github.event.repository.name }}-coverage-report
173+
path: coverage/
174+
175+
- name: Upload artifacts
176+
uses: actions/upload-artifact@v3
177+
with:
178+
name: ${{ github.event.repository.name }}-artifacts
179+
path: artifacts/

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.phpunit.result.cache
2+
/composer.lock
3+
/coverage
4+
/vendor

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## 1.0.0 - 2022-07-11
9+
10+
### Added
11+
- Initial release.

LICENSE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Copyright (c) 2022 Tectalic (https://tectalic.com)
2+
3+
For copyright and license information, please view https://tectalic.com/terms

0 commit comments

Comments
 (0)