Skip to content

Create ci.yml

Create ci.yml #1

Workflow file for this run

name: CI
on:
- push
- pull_request
jobs:
build-php:
name: Prepare PHP
runs-on: ubuntu-20.04
strategy:
matrix:
php:
- "8.2"
steps:
- name: Build and prepare PHP cache
uses: pmmp/setup-php-action@main
with:
php-version: ${{ matrix.php }}
install-path: "../bin"
pm-version-major: "5"
fmt:
name: code style check
needs: [build-php]
runs-on: ubuntu-20.04
strategy:
matrix:
php:
- "8.2"
steps:
- uses: actions/checkout@v3
- uses: pmmp/setup-php-action@main
with:
php-version: ${{ matrix.php }}
install-path: "../bin"
pm-version-major: "5"
- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php
- run: composer install
- run: composer fmt
- run: git diff --exit-code
phpstan:
name: phpstan analyze
needs: [build-php]
runs-on: ubuntu-20.04
strategy:
matrix:
php:
- "8.2"
steps:
- uses: actions/checkout@v3
- uses: pmmp/setup-php-action@main
with:
php-version: ${{ matrix.php }}
install-path: "../bin"
pm-version-major: "5"
- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php
- run: composer install
- name: phpstan analyze
run: composer analyze
pharynx:
name: build phar
permissions:
contents: write
needs: [build-php]
runs-on: ubuntu-20.04
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
strategy:
matrix:
php:
- "8.2"
steps:
- uses: actions/checkout@v3
- uses: pmmp/setup-php-action@main
with:
php-version: ${{ matrix.php }}
install-path: "../bin"
pm-version-major: "5"
- uses: SOF3/pharynx@v0.2
id: pharynx
- uses: actions/upload-artifact@v3
with:
name: plugin.phar
path: ${{steps.pharynx.outputs.output-phar}}