Skip to content

Commit

Permalink
config: update some github action cofig
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Nov 16, 2022
1 parent e0cebde commit f0fae3d
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 23 deletions.
36 changes: 36 additions & 0 deletions .github/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
title: '## Change Log'
# style allow: simple, markdown(mkdown), ghr(gh-release)
style: gh-release
# group names
names: [Refactor, Fixed, Feature, Update, Other]
#repo_url: https://github.com/gookit/gcli

filters:
# message length should >= 12
- name: msg_len
min_len: 12
# message words should >= 3
- name: words_len
min_len: 3
- name: keyword
keyword: format code
exclude: true
- name: keywords
keywords: format code, action test
exclude: true

# group match rules
# not matched will use 'Other' group.
rules:
- name: Refactor
start_withs: [refactor, break]
contains: ['refactor:', 'break:']
- name: Fixed
start_withs: [fix]
contains: ['fix:']
- name: Feature
start_withs: [feat, new]
contains: ['feat:', 'new:']
- name: Update
start_withs: [up]
contains: ['update:', 'up:']
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
28 changes: 18 additions & 10 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Unit-tests
name: Unit-Tests

# https://docs.github.com/cn/actions/reference/workflow-syntax-for-github-actions
on:
push:
paths:
Expand All @@ -15,9 +16,9 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.0, 8.1]
# os: [ubuntu-latest, macOS-latest] # windows-latest,
# include:
php: [8.0, 8.1] # 7.2, 7.3,
# os: [ubuntu-latest] # macOS-latest, windows-latest,
# include: # will not testing on php 7.2
# - os: 'ubuntu-latest'
# php: '7.2'
# phpunit: '8.5.13'
Expand All @@ -26,23 +27,30 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set ENV vars
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
run: |
echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV
- name: Display Env
run: env

# usage refer https://github.com/shivammathur/setup-php
- name: Setup PHP
timeout-minutes: 10
timeout-minutes: 5
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php}}
tools: pecl, php-cs-fixer, phpunit:${{ matrix.phpunit }}
extensions: mbstring, dom, fileinfo, mysql, openssl, igbinary, redis, swoole-4.6.7 # , swoole-4.4.19 #optional, setup extensions
extensions: mbstring, dom, fileinfo, openssl # , swoole-4.4.19 #optional, setup extensions
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
coverage: none #optional, setup coverage driver: xdebug, none

- name: Install dependencies
run: |
composer install --no-progress
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
- name: Install dependencies
run: composer update --no-progress

- name: Run test suite
run: phpunit --debug
22 changes: 9 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,27 @@ on:

jobs:
release:
name: Test on php ${{ matrix.php}}
name: Tag release
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
php: [8.0]
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set ENV for github-release
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
run: |
echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV
# more see https://github.com/inhere/kite
- name: Generate changelog file
id: changelog
- name: Generate changelog
run: |
wget -c -q https://github.com/inhere/kite/releases/latest/download/kite.phar
php kite.phar git cl prev last --style gh-release --no-merges --fetch-tags --unshallow --file changelog.md
cat changelog.md
curl https://github.com/gookit/gitw/releases/latest/download/chlog-linux-amd64 -L -o /usr/local/bin/chlog
chmod a+x /usr/local/bin/chlog
chlog -c .github/changelog.yml -o changelog.md prev last
# https://github.com/softprops/action-gh-release
- name: Create release and upload assets
Expand All @@ -41,4 +37,4 @@ jobs:
tag_name: ${{ env.RELEASE_TAG }}
body_path: changelog.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f0fae3d

Please sign in to comment.