Skip to content

Commit

Permalink
chore: add pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
le0m committed Oct 18, 2024
1 parent 4f5d5f9 commit a9d0746
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
gh-actions:
patterns: ['actions/*']
docker:
patterns: ['docker/*']
90 changes: 90 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: 'php'

on:
pull_request:
paths:
- '**/*.php'
- '.github/workflows/php.yml'
- 'composer.json'
push:
paths:
- '**/*.php'
- '.github/workflows/php.yml'
- 'composer.json'

jobs:
cs:
name: 'Check coding style'
if: "!contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]')"
runs-on: 'ubuntu-latest'
strategy:
matrix:
php-version: ["8.2","8.3"]
steps:
- name: 'Checkout current revision'
uses: 'actions/checkout@v4'

- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php-version }}'
tools: 'composer:v2'
extensions: 'mbstring, intl'
coverage: 'none'

- name: 'Discover Composer cache directory'
id: 'cachedir'
run: echo "path=$(composer global config cache-dir)" >> $GITHUB_OUTPUT

- name: 'Share Composer cache across runs'
uses: 'actions/cache@v4'
with:
path: '${{ steps.cachedir.outputs.path }}'
key: "composer-${{ github.job }}-${{ hashFiles('**/composer.json') }}"
restore-keys: |
composer-${{ github.job }}-
composer-
- name: 'Install dependencies with Composer'
run: 'composer install --prefer-dist --no-interaction --ignore-platform-req=ext-opentelemetry'

- name: 'Run PHP CodeSniffer'
run: vendor/bin/phpcs -n

stan:
name: 'Static code analyzer'
if: "!contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]')"
runs-on: 'ubuntu-latest'
strategy:
matrix:
php-version: ["8.2","8.3"]
steps:
- name: 'Checkout current revision'
uses: 'actions/checkout@v4'

- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php-version }}'
tools: 'composer:v2'
extensions: 'mbstring, intl'
coverage: 'none'

- name: 'Discover Composer cache directory'
id: 'cachedir'
run: echo "path=$(composer global config cache-dir)" >> $GITHUB_OUTPUT

- name: 'Share Composer cache across runs'
uses: 'actions/cache@v4'
with:
path: '${{ steps.cachedir.outputs.path }}'
key: "composer-${{ github.job }}-${{ hashFiles('**/composer.json') }}"
restore-keys: |
composer-${{ github.job }}-
composer-
- name: 'Install dependencies with Composer'
run: 'composer install --prefer-dist --no-interaction --ignore-platform-req=ext-opentelemetry'

- name: 'Run PHP STAN'
run: vendor/bin/phpstan analyse --no-progress --error-format=github
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release

on:
pull_request_target:
types: [closed]
workflow_dispatch:
inputs:
releaseType:
description: 'Release type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
jobs:
release-job:
uses: bedita/github-workflows/.github/workflows/release.yml@v1
with:
main_branch: 'main'
dist_branches: '["main"]'
version_bump: ${{ inputs.releaseType }}

0 comments on commit a9d0746

Please sign in to comment.