Skip to content

Commit

Permalink
ci: integrate release-please
Browse files Browse the repository at this point in the history
  • Loading branch information
DASPRiD committed Mar 19, 2024
1 parent 788bb77 commit d0aba4c
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: PHP CI
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master
- main

jobs:
lint:
Expand Down Expand Up @@ -61,3 +58,11 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./clover.xml

release:
needs: [lint, test]
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
with:
release-type: php
61 changes: 61 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Pull Request

on:
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: phpcs

- name: Lint
run: phpcs

test:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1', '8.2', '8.3']
runs-on: ${{ matrix.operating-system }}
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: iconv, imagick
coverage: xdebug

- 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.json') }}
restore-keys: ${{ runner.os }}-composer-

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

- name: Test with phpunit
run: vendor/bin/phpunit --coverage-clover clover.xml

- name: Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./clover.xml

0 comments on commit d0aba4c

Please sign in to comment.