Skip to content

Commit

Permalink
Merge pull request #1 from xefi/feature/unit-testing
Browse files Browse the repository at this point in the history
✨ CI/CD
  • Loading branch information
GautierDele authored Aug 17, 2024
2 parents 8f6aa84 + 25bf52a commit 61d7048
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/packagist-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Packagist Deploy

on:
release:
types: [created]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4
- uses: mnavarrocarter/packagist-update@v1.0.0
with:
username: "GautierDele"
api_token: ${{ secrets.PACKAGIST_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version: [ '8.2', '8.3', '8.4' ]

name: Tests on PHP ${{ matrix.php-version }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-version }}-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer i --prefer-dist --no-progress

- name: Run test suite
run: vendor/bin/phpunit

0 comments on commit 61d7048

Please sign in to comment.