Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Homebrew integration #1055

Open
wants to merge 15 commits into
base: 3.x
Choose a base branch
from
26 changes: 26 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
on:
push:
branches:
- main
name: Create release on merge with Main
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
- First Change
- Second Change
draft: false
prerelease: true
34 changes: 34 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
pull_request:
branches:
- main
- 3.x
name: Build Phar on Pull Request CI
jobs:
checkout_build:
runs-on: ubuntu-latest
container:
image: quay.io/pantheon-public/php-ci:v7.4
name: Checkout & build Phar
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Save repo content as artifact
uses: actions/upload-artifact@v2
with:
name: full-workspace
path: ${{ github.workspace }}
- name: Full Composer Install
run: composer install
- name: Validate Code
run: composer code:lint
- name: Phar Build
run: composer phar:build
- name: permissions
run: chmod +x ./robo
- name: Save robo.phar as artifact
uses: actions/upload-artifact@v2
with:
name: robo-phar
path: robo
if-no-files-found: error
63 changes: 35 additions & 28 deletions .github/workflows/ci.yml → .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
# From https://github.com/sebastianbergmann/phpunit/blob/20ab19d3aed56fccf9569cd33c6cd0baab0ec272/.github/workflows/ci.yml
# (With many modifications)

on:
pull_request:
branches:
- 3.x
push:
branches:
branches: # Add development branches here
- 3.x
- homebrew-integration

name: CI

name: Unit Testing CI on Push to development branches
jobs:
checkout_build:
runs-on: ubuntu-latest
container:
image: quay.io/pantheon-public/php-ci:v7.4
name: Checkout & build Phar
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Full Composer Install
run: composer install
- name: Phar Build
run: composer phar:build
- name: permissions
run: chmod +x ./robo
- name: Save repo content as artifact
uses: actions/upload-artifact@v2
with:
name: full-workspace
path: ${{ github.workspace }}

coding-guidelines:
name: Coding Guidelines

runs-on: ubuntu-latest

needs:
- checkout_build
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -31,16 +45,16 @@ jobs:
run: composer install --no-ansi --no-interaction --no-progress

- name: Run phpcs
run: composer cs
run: composer code:cs

- name: Run linter
run: composer lint
run: composer code:lint

backward-compatibility:
name: Backward Compatibility

runs-on: ubuntu-latest

needs:
- checkout_build
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -67,9 +81,9 @@ jobs:

tests:
name: Tests

runs-on: ${{ matrix.os }}

needs:
- checkout_build
env:
PHP_EXTENSIONS: dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter

Expand All @@ -89,17 +103,10 @@ jobs:
- locked

include:
- os: ubuntu-latest
php-version: "7.1"
dependencies: lowest

- os: ubuntu-latest
php-version: "7.4"
dependencies: highest

- os: ubuntu-latest
php-version: "8.0"
dependencies: highest
php-ini-values: assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit_buffer_size=4096M, opcache.jit=1205

steps:
Expand Down Expand Up @@ -131,8 +138,8 @@ jobs:
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-

- name: Make sure composer.json is valid before we start modifyig it
run: composer validate
run: composer validate --strict

- name: Clear platform php configuration in case we need to update phpunit
run: composer config --unset platform.php

Expand All @@ -151,8 +158,8 @@ jobs:
run: composer update --no-ansi --no-interaction --no-progress

- name: Run tests with phpunit
run: composer unit
run: composer code:unit

- name: Publish code coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '8.0'
run: bash <(curl -s https://codecov.io/bash)
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
release:
branches:
- main
name: Update Homebrew on Release
jobs:
package_macos:
runs-on: macos-latest
name: Package a Homebrew release
steps:
- name: Bump Homebrew formula
uses: dawidd6/action-homebrew-bump-formula@v3
with:
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
tap: consolidated/external
tag: ${{github.ref}}
revision: ${{github.sha}}
formula: robo
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ tests/_log/*
tests/_helpers/_generated/*
*.phar
.phpunit.result.cache
.DS_Store
/robo
File renamed without changes.
Loading