Skip to content

Commit

Permalink
Merge pull request #116 from phpolar/update-github-workflows
Browse files Browse the repository at this point in the history
ci: update github workflows
  • Loading branch information
ericfortmeyer committed Aug 20, 2023
2 parents a7ea7ae + 335096b commit 14d26f3
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 5 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/auto-merge.yml
@@ -1,7 +1,15 @@
name: auto-merge
name: Auto Merge Dependabot PRs

on:
pull_request_target:
paths-ignore:
- '**.php'
- '**.yml'
- '**.md'
- '**.svg'
- '**.xml'
- '.gitattributes'
- '.gitignore'

jobs:
auto-merge:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/php-latest.yml
@@ -0,0 +1,39 @@
name: PHP Build Latest and Nightly

on:
schedule:
- cron: '19 7 * * 6'

jobs:
build:
runs-on: ${{ matrix.operating-system }}
continue-on-error: true
strategy:
matrix:
operating-system: ['ubuntu-22.04', 'ubuntu-20.04', 'windows-latest', 'macos-latest']
php-versions: [latest, nightly]
phpunit-versions: ['latest']
steps:
- uses: actions/checkout@v3

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

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer update --no-ansi --no-interaction --prefer-dist --no-progress --ignore-platform-req=ext-ast

- name: Run test suite
run: composer ci:test-build
10 changes: 6 additions & 4 deletions .github/workflows/phpmd.yml
Expand Up @@ -16,13 +16,15 @@
name: PHPMD

on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '19 7 * * 6'
paths:
- '**.php'
- '!tests/**'
- '!examples/**'
- '!config/**'
- '!.phan/**'

permissions:
contents: read
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/pr-quality.yml
@@ -0,0 +1,46 @@
name: Pull Request Quality Check

on:
pull_request:
branches: [ main ]
paths:
- 'composer.*'
- '**.php'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer update --no-ansi --no-interaction --prefer-dist --no-progress --ignore-platform-req=ext-ast && composer dumpautoload

- name: Scanning for lint errors
run: composer ci:lint

- name: Run test suite
run: composer ci:test

- name: Generate Code Coverage Badge
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: composer ci:generate-coverage-badge

0 comments on commit 14d26f3

Please sign in to comment.