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

Create major milestone when PR causes BC break #260

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .github/workflows/set-milestone-on-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,38 @@ on:
- review_requested
jobs:
set-milestone:
name: Set Milestone
if: github.event.pull_request.milestone == null
runs-on: ubuntu-latest
outputs:
check: ${{ steps.generate-checks-strategy.outputs.check }}
steps:
- uses: actions/checkout@v1
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@master"
uses: "WyriHaximus/github-action-get-previous-tag@v1"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: 'Get next minor version'
- name: 'Get next versions'
id: semvers
uses: "WyriHaximus/github-action-next-semvers@master"
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: 'Decide which version fits this PR'
id: decidedversion
run: |
composer install --no-progress --ansi --no-interaction --prefer-dist -o -q

if ! (./vendor/bin/roave-backward-compatibility-check); then
printf "::set-output name=version::%s" "${MAJOR}"
exit 0
fi

printf "::set-output name=version::%s" "${MINOR}"
env:
MAJOR: ${{ steps.semvers.outputs.major }}
MINOR: ${{ steps.semvers.outputs.minor }}
PATCH: ${{ steps.semvers.outputs.patch }}
- name: 'Get Milestones'
uses: "WyriHaximus/github-action-get-milestones@master"
id: milestones
Expand All @@ -34,13 +52,13 @@ jobs:
id: querymilestone
env:
MILESTONES: ${{ steps.milestones.outputs.milestones }}
MILESTONE: ${{ steps.semvers.outputs.minor }}
MILESTONE: ${{ steps.decidedversion.outputs.version }}
- name: 'Create Milestone'
if: steps.querymilestone.outputs.number == ''
id: createmilestone
uses: "WyriHaximus/github-action-create-milestone@master"
uses: "WyriHaximus/github-action-create-milestone@0.1.0"
with:
title: ${{ steps.semvers.outputs.minor }}
title: ${{ steps.decidedversion.outputs.version }}
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: 'Select found or created Milestone'
Expand Down
19 changes: 11 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ SHELL=bash

.PHONY: *

DOCKER_CGROUP:=$(shell cat /proc/1/cgroup | grep docker | wc -l)
COMPOSER_CACHE_DIR:=$(shell composer config --global cache-dir -q || echo ${HOME}/.composer/cache)
COMPOSER_CACHE_DIR=$(shell composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)

ifneq ("$(wildcard /.dockerenv)","")
IN_DOCKER:=TRUE
else ifneq ("$(DOCKER_CGROUP)","0")
IN_DOCKER:=TRUE
ifneq ("$(wildcard /.you-are-in-a-wyrihaximus.net-php-docker-image)","")
IN_DOCKER=TRUE
else
IN_DOCKER:=FALSE
IN_DOCKER=FALSE
endif

ifeq ("$(IN_DOCKER)","TRUE")
Expand Down Expand Up @@ -56,8 +53,14 @@ composer-require-checker: ## Ensure we require every package used in this packag
composer-unused: ## Ensure we don't require any package we don't use in this package directly
$(DOCKER_RUN) composer unused --ansi

composer-install: ## Install dependencies
$(DOCKER_RUN) composer install --no-progress --ansi --no-interaction --prefer-dist -o

backward-compatibility-check: ## Check code for backwards incompatible changes
$(DOCKER_RUN) vendor/bin/roave-backward-compatibility-check || true
$(MAKE) backward-compatibility-check-raw || true

backward-compatibility-check-raw: ## Check code for backwards incompatible changes, doesn't ignore the failure ###
$(DOCKER_RUN) vendor/bin/roave-backward-compatibility-check

shell: ## Provides Shell access in the expected environment ###
$(DOCKER_RUN) ash
Expand Down