Skip to content

Commit

Permalink
[#43] Update repo structure to https://github.com/AlexSkrypnyk/scaffold
Browse files Browse the repository at this point in the history
… (#44)
  • Loading branch information
tannguyen04 authored Dec 25, 2023
1 parent 31cac6b commit b5c0549
Show file tree
Hide file tree
Showing 28 changed files with 659 additions and 271 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

patreon: alexskrypnyk
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Checklist before requesting a review

- [ ] I have formatted the subject to include ticket number
as `[#123] Verb in past tense with dot at the end.`
- [ ] I have added a link to the issue tracker
- [ ] I have provided information in `Changed` section about WHY something was
done if this was not a normal implementation
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have run new and existing relevant tests locally with my changes, and
they passed
- [ ] I have provided screenshots, where applicable

## Changed

1.

## Screenshots
12 changes: 12 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name-template: '$NEXT_MINOR_VERSION'
tag-template: '$NEXT_MINOR_VERSION'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
template: |
## What's new since $PREVIOUS_TAG
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$NEXT_MINOR_VERSION
$CONTRIBUTORS
16 changes: 16 additions & 0 deletions .github/workflows/auto-assign-pr-author.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Auto Author Assign'

on:
pull_request_target:
types:
- opened
- reopened

permissions:
pull-requests: write

jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/[email protected]
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release

on:
push:
tags:
- '*'
branches:
- main

permissions:
contents: write

jobs:
release-drafter:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
# Package and push files to remote repositories
Robo task to push git artifact to remote repository
<p align="center">
<a href="" rel="noopener">
<img width=200px height=200px src="https://placehold.jp/000000/ffffff/200x200.png?text=Git+Artifact&css=%7B%22border-radius%22%3A%22%20100px%22%7D" alt="Git Artifact"></a>
</p>

<h1 align="center">Package and push files to remote repositories</h1>

<div align="center">

[![GitHub Issues](https://img.shields.io/github/issues/drevops/git-artifact.svg)](https://github.com/drevops/git-artifact/issues)
[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/drevops/git-artifact.svg)](https://github.com/drevops/git-artifact/pulls)
[![CircleCI](https://circleci.com/gh/drevops/git-artifact.svg?style=shield)](https://circleci.com/gh/drevops/git-artifact)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/drevops/git-artifact)
[![Total Downloads](https://poser.pugx.org/drevops/behat-screenshot/downloads)](https://packagist.org/packages/drevops/git-artifact)
![LICENSE](https://img.shields.io/github/license/drevops/git-artifact)
![Renovate](https://img.shields.io/badge/renovate-enabled-green?logo=renovatebot)

</div>

---

<p align="center">Robo task to push git artifact to remote repository.
<br>
</p>

## What is it?
Build artifact from your codebase in CI and push it to a separate git repo.
Expand Down Expand Up @@ -178,7 +195,7 @@ In this example, all commits in the repository will be pushed to the same branch

In this example, if the latest commit was tagged with tag `1.2.0`, the artifact will be pushed to the branch `release/1.2.0`. If there latest commit is tagged with multiple tags - they will be glued to gether with delimiter `-`, which would reult in the branch name `release/1.2.0-secondtag`.

## Contributing
## Maintenance / Contributing
1. Fork this repo.
2. Check it out locally and create a feature branch.
3. `composer install` to install all required dependencies.
Expand Down
6 changes: 5 additions & 1 deletion RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@
*/

use DrevOps\Robo\ArtefactTrait;
use Robo\Tasks;

/**
* Class RoboFile.
*/
class RoboFile extends \Robo\Tasks
class RoboFile extends Tasks
{

use ArtefactTrait {
ArtefactTrait::__construct as private __artifactConstruct;
}

/**
* Constructor.
*/
public function __construct()
{
$this->__artifactConstruct();
Expand Down
25 changes: 19 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
{
"name": "drevops/git-artifact",
"description": "Build artifact from your codebase in CI and push it to a separate git repo.",
"type": "robo-tasks",
"description": "Build artifact from your codebase in CI and push it to a separate git repo.",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Alex Skrypnyk",
"email": "[email protected]"
}
],
"homepage": "https://github.com/drevops/git-artifact",
"support": {
"issues": "https://github.com/drevops/git-artifact/issues",
"source": "https://github.com/drevops/git-artifact"
},
"require": {
"consolidation/robo": "^4"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.6",
"phpunit/phpunit": "^9.5",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"escapestudios/symfony2-coding-standard": "^3"
"escapestudios/symfony2-coding-standard": "^3",
"phpmd/phpmd": "^2.15",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.5",
"squizlabs/php_codesniffer": "^3.6"
},
"scripts": {
"lint": "./vendor/bin/phpcs -s",
"test": "./vendor/bin/phpunit --colors=always --fail-on-warning",
"lint": [
"phpcs",
"phpmd --exclude vendor . text phpmd.xml",
"phpstan"
],
"lint:fix": "phpcbf",
"test": "phpunit --no-coverage",
"test:coverage": "XDEBUG_MODE=coverage phpunit",
"clean": "vagrant -f destroy &>/dev/null || $(which true); rm -Rf $(pwd)/.vagrant; rm -Rf $(pwd)/.beetbox; rm -Rf $(pwd)/Vagrantfile; rm -Rf $(pwd)/vendor; rm -Rf $(pwd)/screenshots;",
"install-codestandards": [
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
Expand Down
29 changes: 23 additions & 6 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
<?xml version="1.0"?>
<ruleset name="git-artifact">
<description>Custom coding standard.</description>
<ruleset name="custom">
<description>Custom PHPCS standard.</description>

<rule ref="Symfony"/>
<!-- Coding standard. -->
<rule ref="Symfony">
<exclude name="Symfony.Commenting.FunctionComment.SpacingAfterParamType" />
</rule>

<!-- Show sniff codes in all reports -->
<arg value="s"/>
<!-- Show progress of the run. -->
<arg value="p"/>
<arg name="colors"/>

<!--
PHP_CodeSniffer does not support scanning of files without extensions, so
we have to use the ugly workaround to copy the file into a file with a 'php'
extension, scan that file, and then delete it.
@see https://github.com/squizlabs/PHP_CodeSniffer/issues/2916
-->
<file>src</file>
<file>RoboFile.php</file>
<file>tests</file>

<arg name="colors"/>
<arg value="sp"/>

<rule ref="Symfony.Commenting.License.Warning">
<exclude-pattern>*.*</exclude-pattern>
</rule>
Expand All @@ -20,6 +33,10 @@
<exclude-pattern>*.*</exclude-pattern>
</rule>

<rule ref="PSR1">
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
</rule>

<!--Allow uncommented functions in tests as they usually provide enough
information from their names.-->
<rule ref="Symfony.Commenting.FunctionComment.Missing">
Expand Down
15 changes: 15 additions & 0 deletions phpmd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<ruleset name="Custom PHPMD ruleset."
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">

<rule ref="rulesets/unusedcode.xml"/>
<rule ref="rulesets/codesize.xml"/>
<rule ref="rulesets/cleancode.xml/MissingImport">
<properties>
<property name="ignore-global" value="true"/>
</properties>
</rule>
</ruleset>
18 changes: 18 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
##
# Configuration file for PHPStan static code checking, see https://phpstan.org .
#

parameters:

level: 9

paths:
- src
- tests
- RoboFile.php

excludePaths:
- vendor/*
- node_modules/*

ignoreErrors:
31 changes: 30 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="./vendor/autoload.php">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
requireCoverageMetadata="true"
beStrictAboutCoverageMetadata="false"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
>
<testsuites>
<testsuite name="GitArtefact">
<directory>./tests/</directory>
</testsuite>
</testsuites>

<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<file>src</file>
</include>
</source>

<coverage includeUncoveredFiles="true"
pathCoverage="false"
ignoreDeprecatedCodeUnits="true"
disableCodeCoverageIgnore="false">
<report>
<html outputDirectory=".coverage-html" lowUpperBound="50" highLowerBound="90"/>
<cobertura outputFile="cobertura.xml"/>
</report>
</coverage>
</phpunit>
8 changes: 8 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"automerge": true,
"dependencyDashboard": true,
"extends": [
"config:base"
]
}
Loading

0 comments on commit b5c0549

Please sign in to comment.