Skip to content

Commit

Permalink
Added aeon-php/automation integration (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech authored Jan 25, 2021
1 parent d3b9adf commit f667b16
Show file tree
Hide file tree
Showing 10 changed files with 249 additions and 27 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/changelog-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Changelog - Release Unreleased"

###################################################################
# WARNING - THIS ACTION WILL PUSH COMMIT DIRECTLY INTO REPOSITORY #
###################################################################

on:
push:
tags:
- '*'

jobs:
changelog-release-unreleased:
name: "Update Changelog - Release Unreleased"

runs-on: "ubuntu-latest"

steps:
- name: "Get tag name"
id: "tag-name"
run: |
tag=$(echo ${{ github.event.ref }} | cut -c11-)
echo "::set-output name=tag::$tag"
- name: "Update CHANGELOG"
uses: "docker://aeonphp/automation:latest"
env:
AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
entrypoint: "/composer/vendor/bin/automation"
args: "changelog:release:unreleased ${{ github.repository }} CHANGELOG.md ${{ steps.tag-name.outputs.tag }} --github-file-changelog-update"
38 changes: 38 additions & 0 deletions .github/workflows/changelog-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Changelog - Update Unreleased"

###################################################################
# WARNING - THIS ACTION WILL PUSH COMMIT DIRECTLY INTO REPOSITORY #
###################################################################

on:
push:
branches:
- 1.x

jobs:
changelog-update-unreleased:
name: "Changelog - Update Unreleased"

runs-on: "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Restore Automation cache"
uses: "actions/cache@v2"
with:
path: |
cache
key: "${{ runner.os }}-automation-${{ hashFiles('**/CHANGELOG.md') }}"
restore-keys: |
${{ runner.os }}-automation-
- name: "Update CHANGELOG"
uses: "docker://aeonphp/automation:latest"
env:
AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
EON_AUTOMATION_CACHE_DIR: "/github/workspace/cache"
with:
entrypoint: "/composer/vendor/bin/automation"
args: "changelog:generate ${{ github.repository }} --github-file-update-path=CHANGELOG.md --skip-from=\"dependabot[bot]\" --skip-from=\"aeon-automation\""
26 changes: 20 additions & 6 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,28 @@ jobs:
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1

- name: "Cache dependencies"
- name: "Cache Phive dependencies"
uses: "actions/cache@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
~/.phive
key: "${{ runner.os }}-phive-${{ hashFiles('**/phars.xml') }}"
restore-keys: |
${{ runner.os }}-phive-
- name: "Get Composer Cache Directory"
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: "Cache Composer dependencies"
uses: "actions/cache@v2"
with:
path: |
${{ steps.composer-cache.outputs.dir }}
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: |
php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
Expand All @@ -57,7 +71,7 @@ jobs:
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install tools"
run: "phive install --trust-gpg-keys E82B2FB314E9906E,C5095986493B4AA0,CF1A108D0E7AE720,8A03EA3B385DBAA1,4AA394086372C20A --force-accept-unsigned"
run: "phive install --trust-gpg-keys E82B2FB314E9906E,C5095986493B4AA0,CF1A108D0E7AE720,12CE0F1D262429A5,4AA394086372C20A --force-accept-unsigned"

- name: "Mutation Tests"
run: "composer test:mutation"
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/pull-request-description-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Pull Request Description Check"

on:
pull_request:
types: ["opened", "edited", "reopened", "ready_for_review"]

jobs:
pull-request-description-check:
name: "Pull Request Description"

runs-on: "ubuntu-latest"

steps:
- name: "Pull Request Description - Check"
uses: "docker://aeonphp/automation:latest"
env:
AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
entrypoint: "/composer/vendor/bin/automation"
args: "pull-request:description:check ${{ github.repository }} ${{ github.event.pull_request.number }} --skip-from=\"dependabot[bot]\""
25 changes: 25 additions & 0 deletions .github/workflows/release-description-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Release - Description Update"

#########################################################
# WARNING - THIS ACTION WILL UPDATE RELEASE DESCRIPTION #
#########################################################

on:
release:
types:
- created

jobs:
release-description-update:
name: "Release - Description Update"

runs-on: "ubuntu-latest"

steps:
- name: "Update CHANGELOG"
uses: "docker://aeonphp/automation:latest"
env:
AEON_AUTOMATION_GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
entrypoint: "/composer/vendor/bin/automation"
args: "changelog:generate ${{ github.repository }} --tag=${{ github.event.release.tag_name }} --github-release-update --skip-from=\"dependabot[bot]\" --skip-from=\"aeon-automation\""
26 changes: 20 additions & 6 deletions .github/workflows/static-analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,28 @@ jobs:
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1

- name: "Cache dependencies"
- name: "Cache Phive dependencies"
uses: "actions/cache@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
~/.phive
key: "${{ runner.os }}-phive-${{ hashFiles('**/phars.xml') }}"
restore-keys: |
${{ runner.os }}-phive-
- name: "Get Composer Cache Directory"
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: "Cache Composer dependencies"
uses: "actions/cache@v2"
with:
path: |
${{ steps.composer-cache.outputs.dir }}
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: |
php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
Expand All @@ -57,7 +71,7 @@ jobs:
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install tools"
run: "phive install --trust-gpg-keys E82B2FB314E9906E,C5095986493B4AA0,CF1A108D0E7AE720,8A03EA3B385DBAA1,4AA394086372C20A --force-accept-unsigned"
run: "phive install --trust-gpg-keys E82B2FB314E9906E,C5095986493B4AA0,CF1A108D0E7AE720,12CE0F1D262429A5,4AA394086372C20A --force-accept-unsigned"

- name: "Static Analyze"
run: "composer static:analyze"
26 changes: 20 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,28 @@ jobs:
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1

- name: "Cache dependencies"
- name: "Cache Phive dependencies"
uses: "actions/cache@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
~/.phive
key: "${{ runner.os }}-phive-${{ hashFiles('**/phars.xml') }}"
restore-keys: |
${{ runner.os }}-phive-
- name: "Get Composer Cache Directory"
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: "Cache Composer dependencies"
uses: "actions/cache@v2"
with:
path: |
${{ steps.composer-cache.outputs.dir }}
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: |
php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
Expand All @@ -60,7 +74,7 @@ jobs:
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install tools"
run: "phive install --trust-gpg-keys E82B2FB314E9906E,C5095986493B4AA0,CF1A108D0E7AE720,8A03EA3B385DBAA1,4AA394086372C20A --force-accept-unsigned"
run: "phive install --trust-gpg-keys E82B2FB314E9906E,C5095986493B4AA0,CF1A108D0E7AE720,12CE0F1D262429A5,4AA394086372C20A --force-accept-unsigned"

- name: "Tests"
run: "composer test"
8 changes: 4 additions & 4 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="php-cs-fixer" version="^2.17.1" installed="2.17.1" location="./tools/php-cs-fixer" copy="true"/>
<phar name="php-cs-fixer" version="^2.17.1" installed="2.18.1" location="./tools/php-cs-fixer" copy="true"/>
<phar name="infection" version="^0.20.1" installed="0.20.1" location="./tools/infection" copy="true"/>
<phar name="phpstan" version="^0.12.59" installed="0.12.59" location="./tools/phpstan" copy="true"/>
<phar name="psalm" version="^4.3.1" installed="4.3.1" location="./tools/psalm" copy="true"/>
<phar name="phpunit" version="^9.5.0" installed="9.5.0" location="./tools/phpunit.phar" copy="true"/>
<phar name="phpstan" version="^0.12.59" installed="0.12.69" location="./tools/phpstan" copy="true"/>
<phar name="psalm" version="^4.3.1" installed="4.4.1" location="./tools/psalm" copy="true"/>
<phar name="phpunit" version="^9.5.0" installed="9.5.1" location="./tools/phpunit.phar" copy="true"/>
</phive>
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
"keywords": [
"calendar",
"immutable",
"holidays",
"sleep"
"holidays"
],
"prefer-stable": true,
"minimum-stability": "dev",
"require": {
"php": ">=7.4.2",
"ext-json": "*",
"ext-mbstring": "*",
"aeon-php/calendar": ">=0.13.0"
"aeon-php/calendar": ">=0.14.0"
},
"require-dev": {
"google/apiclient": "^2.0"
Expand Down
Loading

0 comments on commit f667b16

Please sign in to comment.