Skip to content

Commit

Permalink
ci: Update Github actions configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Nov 11, 2020
1 parent b251d59 commit 2a8aec5
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
git config --global core.eol lf
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v2.3.4
with:
fetch-depth: 1

- name: Install PHP
uses: shivammathur/setup-php@master
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring,xdebug,pcov
extensions: mbstring,pcov,xdebug

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -45,7 +45,7 @@ jobs:
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run Grumphp
run: vendor/bin/grumphp run --no-ansi -n
Expand All @@ -64,7 +64,7 @@ jobs:

- name: Infection score report
run: |
vendor/bin/infection run -j 10
vendor/bin/infection run -j 2
continue-on-error: true

- name: PHP Insights report
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/prune.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# https://docs.github.com/en/actions

name: "Prune"

on: # yamllint disable-line rule:truthy
schedule:
- cron: "0 12 * * *"

env:
DAYS_BEFORE_CLOSE: 5
DAYS_BEFORE_STALE: 5

jobs:
prune:
name: "Issues"

runs-on: "ubuntu-latest"

steps:
- name: "Prune issues and pull requests"
uses: "actions/stale@v3.0.12"
with:
days-before-close: "${{ env.DAYS_BEFORE_CLOSE }}"
days-before-stale: "${{ env.DAYS_BEFORE_STALE }}"
repo-token: "${{ secrets.GITHUB_TOKEN }}"
stale-issue-label: "stale"
stale-issue-message: |
Since this issue has not had any activity within the last ${{ env.DAYS_BEFORE_STALE }} days, I have marked it as stale.
I will close it if no further activity occurs within the next ${{ env.DAYS_BEFORE_CLOSE }} days.
stale-pr-label: "stale"
stale-pr-message: |
Since this pull request has not had any activity within the last ${{ env.DAYS_BEFORE_STALE }} days, I have marked it as stale.
I will close it if no further activity occurs within the next ${{ env.DAYS_BEFORE_CLOSE }} days.
44 changes: 44 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# https://docs.github.com/en/actions

name: "Release"

on: # yamllint disable-line rule:truthy
push:
tags:
- "**"

jobs:
release:
name: "Release"

runs-on: "ubuntu-latest"

steps:
- name: Checkout
uses: actions/checkout@v2.3.3
with:
fetch-depth: 1

- name: Determine tag
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/}
shell: bash

- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md

- name: "Create release"
uses: "actions/create-release@v1.1.4"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
release_name: "${{ steps.tag_name.outputs.current_version }}"
tag_name: "${{ steps.tag_name.outputs.current_version }}"
body: ${{ steps.changelog_reader.outputs.changes }}
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}

0 comments on commit 2a8aec5

Please sign in to comment.