-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3122158
commit db2f88e
Showing
1 changed file
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
|
||
# ---------------------------------------------------------------------------- | ||
# Security | ||
# ---------------------------------------------------------------------------- | ||
|
||
security: | ||
name: Security | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ '8.2' ] | ||
os: [ ubuntu-latest ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v2 | ||
coverage: none | ||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Restore Composer Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer- | ||
- name: Install Dependencies | ||
uses: nick-invision/retry@v2 | ||
with: | ||
timeout_minutes: 5 | ||
max_attempts: 5 | ||
command: composer install --prefer-dist --no-interaction --no-progress | ||
- name: Execute Security Audit | ||
run: composer audit | ||
|
||
# ---------------------------------------------------------------------------- | ||
# Static Analysis | ||
# ---------------------------------------------------------------------------- | ||
|
||
psalm: | ||
name: Psalm | ||
runs-on: ${{ matrix.os }} | ||
if: "!contains(github.event.head_commit.message, '[ci skip]')" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ '8.2' ] | ||
os: [ ubuntu-latest ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v2 | ||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Restore Composer Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer- | ||
- name: Install Dependencies | ||
uses: nick-invision/retry@v2 | ||
with: | ||
timeout_minutes: 5 | ||
max_attempts: 5 | ||
command: composer install --prefer-dist --no-interaction --no-progress | ||
- name: Execute Static Analysis | ||
run: vendor/bin/psalm --php-version=${{ matrix.php }} | ||
|
||
# ---------------------------------------------------------------------------- | ||
# Execute Test Cases | ||
# ---------------------------------------------------------------------------- | ||
|
||
test: | ||
name: Build (PHP ${{matrix.php}}, ${{ matrix.os }}, ${{ matrix.stability }}) | ||
runs-on: ${{ matrix.os }} | ||
if: "!contains(github.event.head_commit.message, '[ci skip]')" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ] | ||
os: [ ubuntu-latest, macos-latest, windows-latest ] | ||
stability: [ prefer-lowest, prefer-stable ] | ||
steps: | ||
- name: Set Git To Use LF | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v2 | ||
extensions: mbstring | ||
ini-values: "memory_limit=-1" | ||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Restore Composer Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer- | ||
- name: Install Dependencies (PHP Stable) | ||
uses: nick-invision/retry@v2 | ||
with: | ||
timeout_minutes: 5 | ||
max_attempts: 5 | ||
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress | ||
- name: Execute Tests | ||
run: vendor/bin/phpunit --colors=always |