Skip to content

Commit 8faf33b

Browse files
Merge pull request #4 from NxtLvLSoftware/create-pull-request/patch
2 parents bfc7452 + 6214411 commit 8faf33b

93 files changed

Lines changed: 3479 additions & 2300 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.yml]
12+
indent_size = 2
13+
indent_style = space
14+
15+
[*.json]
16+
indent_size = 2
17+
indent_style = space
18+
insert_final_newline = false
19+
20+
[*.md]
21+
indent_style = space
22+
indent_size = 2
23+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
*.php text eol=lf
4+
*.xml text eol=lf
5+
*.json text eol=lf
6+
*.yml text eol=lf
7+
*.md text eol=lf

.github/banner-dark.svg

Lines changed: 13 additions & 0 deletions
Loading

.github/banner-light.svg

Lines changed: 13 additions & 0 deletions
Loading

.github/pages/Gemfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
source "https://rubygems.org"
2+
3+
gem "minima", "~> 2.5"
4+
5+
gem "github-pages", group: :jekyll_plugins
6+
# If you have any plugins, put them here!
7+
group :jekyll_plugins do
8+
9+
end
10+
11+
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
12+
# and associated library.
13+
platforms :mingw, :x64_mingw, :mswin, :jruby do
14+
gem "tzinfo", ">= 1", "< 3"
15+
gem "tzinfo-data"
16+
end
17+
18+
# Performance-booster for watching directories on Windows
19+
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
20+
21+
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
22+
# do not have a Java counterpart.
23+
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
24+
25+
gem "webrick", "~> 1.8"

.github/pages/_config.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
twitter_username: NxtLvlSoftware
2+
github_username: NxtLvlSoftware
3+
4+
lsi: false
5+
safe: true
6+
source: ./
7+
incremental: false
8+
theme: minima
9+
highlighter: rouge
10+
gist:
11+
noscript: false
12+
kramdown:
13+
math_engine: mathjax
14+
syntax_highlighter: rouge

.github/workflows/ci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [dev, dist]
6+
pull_request:
7+
branches: [dev]
8+
9+
permissions:
10+
contents: read
11+
12+
env:
13+
GITHUB_ACTIONS: true
14+
15+
jobs:
16+
test:
17+
name: Test (PhpStan + PhpUnit)
18+
runs-on: ${{ matrix.image }}
19+
timeout-minutes: 5
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
image: [ubuntu-latest]
25+
php-version: [8.2.0, 8.2.9]
26+
27+
steps:
28+
- uses: actions/checkout@v3
29+
30+
- name: Setup PHP ${{ matrix.php-version }} with Xdebug
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php-version }}
34+
tools: composer
35+
36+
- name: Restore Composer package cache
37+
uses: actions/cache@v3
38+
with:
39+
path: |
40+
~/.cache/composer/files
41+
~/.cache/composer/vcs
42+
key: "composer-v2-cache-${{ matrix.php-version }}-${{ hashFiles('./composer.json') }}"
43+
restore-keys: |
44+
composer-v2-cache-
45+
46+
- name: Install Composer dependencies
47+
run: composer install --prefer-dist --no-interaction
48+
49+
- name: Run Tests
50+
run: composer test-ci
51+
52+
stage:
53+
name: Stage changes as pull request
54+
needs: [test]
55+
runs-on: ubuntu-latest
56+
timeout-minutes: 5
57+
58+
if: github.ref == 'refs/heads/dev'
59+
steps:
60+
- run: 'echo "Staging dev changes"'
61+
if: ${{ github.event_name == 'push' }}
62+
- uses: actions/checkout@v3
63+
with:
64+
ref: dist
65+
66+
- name: Reset branch
67+
run: |
68+
git fetch origin dev:dev
69+
git reset --hard dev
70+
71+
- name: Create Pull Request
72+
uses: peter-evans/create-pull-request@v5
73+
with:
74+
token: ${{ secrets.STAGE_DEPLOY_KEY }}
75+
title: Merge dev changes to dist
76+
assignees: JackNoordhuis
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
name: Publish Pages
2+
3+
on:
4+
push:
5+
branches: [dist]
6+
7+
permissions:
8+
contents: write
9+
10+
env:
11+
GITHUB_ACTIONS: true
12+
13+
jobs:
14+
index:
15+
name: Index
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 5
18+
19+
strategy:
20+
fail-fast: true
21+
22+
environment:
23+
name: pages-build
24+
url: ${{ steps.config.outputs.base_url }}
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
ref: staging
30+
sparse-checkout: |
31+
.github/pages/_config.yml
32+
README.md
33+
sparse-checkout-cone-mode: false
34+
35+
- name: Move pages config
36+
run: |
37+
mv .github/pages/_config.yml ./_config.yml
38+
rm -rf ./.github
39+
40+
- name: Setup Pages
41+
id: config
42+
uses: actions/configure-pages@v3
43+
with:
44+
generator_config_file: ./_config.yml
45+
46+
- name: Build Pages
47+
uses: actions/jekyll-build-pages@v1
48+
49+
- uses: actions/upload-artifact@v3
50+
with:
51+
name: pages-index-html
52+
path: |
53+
./_site
54+
!./_site/**/*.md
55+
56+
coverage:
57+
name: Coverage
58+
runs-on: ubuntu-latest
59+
timeout-minutes: 5
60+
61+
strategy:
62+
fail-fast: true
63+
64+
steps:
65+
- uses: actions/checkout@v3
66+
67+
- name: Setup PHP 8.2.9 with Xdebug
68+
uses: shivammathur/setup-php@v2
69+
with:
70+
php-version: 8.2
71+
coverage: xdebug
72+
tools: composer
73+
74+
- name: Restore Composer package cache
75+
uses: actions/cache@v3
76+
with:
77+
path: |
78+
~/.cache/composer/files
79+
~/.cache/composer/vcs
80+
key: "composer-v2-cache-8.2.9-${{ hashFiles('./composer.json') }}"
81+
restore-keys: |
82+
composer-v2-cache-
83+
84+
- name: Install Composer dependencies
85+
run: composer install --prefer-dist --no-interaction
86+
87+
- name: Generate coverage html
88+
run: composer coverage-ci
89+
90+
- name: Generate coverage badge
91+
uses: timkrase/phpunit-coverage-badge@v1.2.1
92+
with:
93+
report_type: html
94+
report: .phpunit/coverage/index.html
95+
coverage_badge_path: .phpunit/coverage/badge.svg
96+
97+
- uses: actions/upload-artifact@v3
98+
with:
99+
name: pages-coverage-html
100+
path: .phpunit/coverage
101+
102+
docs:
103+
name: Docs
104+
runs-on: ubuntu-latest
105+
timeout-minutes: 5
106+
107+
strategy:
108+
fail-fast: true
109+
110+
steps:
111+
- uses: actions/checkout@v3
112+
113+
- name: Setup PHP 8.2.9 with Xdebug
114+
uses: shivammathur/setup-php@v2
115+
with:
116+
php-version: 8.2
117+
tools: composer, phive
118+
119+
- name: Restore Composer package cache
120+
uses: actions/cache@v3
121+
with:
122+
path: |
123+
~/.cache/composer/files
124+
~/.cache/composer/vcs
125+
key: "composer-v2-cache-8.2.9-${{ hashFiles('./composer.json') }}"
126+
restore-keys: |
127+
composer-v2-cache-
128+
129+
- name: Install Composer dependencies
130+
run: composer install --prefer-dist --no-interaction
131+
132+
- name: Install phpDocumentor
133+
run: composer install-php-documentor
134+
135+
- name: Generate phpDocumentor html
136+
run: composer docs-ci
137+
138+
- uses: actions/upload-artifact@v3
139+
with:
140+
name: pages-docs-html
141+
path: ./docs-build
142+
143+
package:
144+
name: Package
145+
needs: [index, coverage, docs]
146+
runs-on: ubuntu-latest
147+
timeout-minutes: 5
148+
149+
strategy:
150+
fail-fast: true
151+
152+
steps:
153+
- uses: actions/download-artifact@v3
154+
with:
155+
name: pages-index-html
156+
path: ./
157+
158+
- uses: actions/download-artifact@v3
159+
with:
160+
name: pages-coverage-html
161+
path: ./coverage
162+
163+
- uses: actions/download-artifact@v3
164+
with:
165+
name: pages-docs-html
166+
path: ./docs
167+
168+
- name: Fix permissions
169+
run: |
170+
chmod -c -R +rX "./" | while read line; do
171+
echo "::warning title=Invalid file permissions automatically fixed::$line"
172+
done
173+
174+
- uses: actions/upload-pages-artifact@v2
175+
with:
176+
name: github-pages
177+
path: ./
178+
179+
publish:
180+
name: Publish
181+
needs: [package]
182+
runs-on: ubuntu-latest
183+
timeout-minutes: 5
184+
185+
strategy:
186+
fail-fast: true
187+
188+
permissions:
189+
pages: write
190+
id-token: write
191+
192+
environment:
193+
name: github-pages
194+
url: ${{ steps.deployment.outputs.page_url }}
195+
196+
steps:
197+
- name: Deploy to GitHub Pages
198+
id: deployment
199+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)