Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ permissions:

jobs:
lint:
uses: ./.github/workflows/lint.yaml
uses: ./.github/workflows/lint.yaml
tests:
uses: ./.github/workflows/tests.yaml
needs: lint
snyk:
uses: ./.github/workflows/snyk.yaml
needs: [lint, tests]
secrets: inherit
20 changes: 20 additions & 0 deletions .github/workflows/snyk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Snyk Security Scan

on:
workflow_call:
secrets:
SNYK_TOKEN:
required: true

jobs:
security:
name: Run Snyk to check for vulnerabilities
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/php@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=high
39 changes: 39 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Tests

on:
workflow_call:

jobs:
tests:
name: Run tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: openssl, json
coverage: none

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run tests
run: composer run test


3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/vendor/
/composer.lock
/.idea/
/.vscode/
/.phpunit.result.cache
/.phpunit.cache/
/.php-cs-fixer.cache
/phpunit.xml
/.env
*.log
*.log
Loading