Skip to content

Commit

Permalink
Add actions
Browse files Browse the repository at this point in the history
  • Loading branch information
silverhack committed Jul 29, 2022
1 parent c161931 commit 28fe378
Show file tree
Hide file tree
Showing 7 changed files with 223 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Bug report
about: Create a report to help us improve
title: "[Bug]: "
labels: bug, status/needs-triage
assignees: ''
---

<!--
Please use this template to create your bug report. By providing as much info as possible you help us understand the issue, reproduce it and resolve it for you quicker. Therefore, take a couple of extra minutes to make sure you have provided all info needed.
PROTIP: record your screen and attach it as a gif to showcase the issue.
- How to record and attach gif: https://bit.ly/2Mi8T6K
-->

**What happened?**
A clear and concise description of what the bug is or what is not working as expected


**How to reproduce it**
Steps to reproduce the behavior:
1. What command are you running?
2. See error

**Expected behavior**
A clear and concise description of what you expected to happen.


**Screenshots or Logs**
If applicable, add screenshots to help explain your problem.
Also, you can add logs (Please anonymize them first!). The following command may help to share a log
`Invoke-Monkey365 -Instance...... -Verbose -Debug -InformationAction Continue -WriteLog` then attach here `monkey365_exceptions_%date%.log`


**From where are you running Monkey365?**
Please, complete the following information:
- Resource: [Docker container, workstation)
- OS: [e.g. Windows, Linux, etc. ]
- PowerShell Version [`$PsVersionTable`]:
- Monkey365 Version:
- Others:


**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement, status/needs-triage
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### Context

Please include a summary of the changes. Please also include relevant motivation and context for this PR.


### Description

Please include a summary of the change and which issue is fixed.


### License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
42 changes: 42 additions & 0 deletions .github/workflows/monkeydocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Build monkey365 docs
#

# NOTES:
# This workflow generates and published the documentation site https://silverhack.github.io/monkey365/.

name: ci docs
on:
push:
branches:
- main
jobs:
deploy:
name: Publish monkey365 docs
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure
run: |
git config user.name github-actions
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
architecture: 'x64'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel
python3 -m pip install -r requirements-docs.txt
- name: Deploy site
run: mkdocs gh-deploy --force
60 changes: 60 additions & 0 deletions .github/workflows/pester.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Pester Tests
on:
# Triggers the workflow on push or pull request events but only for the develop branch
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:
pester-test:
name: Pester test
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
experimental: [false]
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Perform a Pester test from the Tests.ps1 file
shell: pwsh
run: |
[System.Void](Invoke-Pester -script .\tests -PassThru -Show None -OutputFormat NUnit2.5 -OutVariable issues)
$failed_tests = @()
$passed_tests = @()
Foreach ($Result in $issues.Failed) {
[System.Array]$failed_tests += [PSCustomObject]@{
Name = $Result.Name
Status = $Result.Result
Passed = $Result.Passed
ExecutedAt = $Result.ExecutedAt
ErrorMessage = $Result.ErrorRecord.Exception.Message
}
}
Foreach ($Result in $issues.Passed) {
[System.Array]$passed_tests += [PSCustomObject]@{
Name = $Result.Name
Status = $Result.Result
Passed = $Result.Passed
ExecutedAt = $Result.ExecutedAt
}
}
if($passed_tests){
foreach ($e in $passed_tests){
$message = ("test_Name={0},Status={1},Passed={2}, ExecutedAt={3}" -f $e.Name,$e.Status,$e.Passed,$e.ExecutedAt)
$msgObject = [System.Management.Automation.HostInformationMessage]@{
Message = $message
ForegroundColor = [consolecolor]::Green
BackgroundColor = $Host.UI.RawUI.BackgroundColor
}
Write-Information -MessageData $msgObject -InformationAction Continue
}
}
if($failed_tests){
foreach ($e in $failed_tests){
$message = ("test_Name={0},Status={1},Passed={2}, ExecutedAt={3}, ErrorMessage={4}" -f $e.Name,$e.Status,$e.Passed,$e.ExecutedAt,$e.ErrorMessage)
Write-Error -Message $message
}
}
21 changes: 21 additions & 0 deletions .github/workflows/psa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Scan Code with PSScriptAnalyzer

on:
# Triggers the workflow on push or pull request events but only for the develop branch
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:
psscriptanalyzer_job:
name: PsScriptAnalyzer Scan Job
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run PsScriptAnalyzer
uses: ./
with:
path: .\
recurse: true
21 changes: 21 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Close stale issues
on:
schedule:
- cron: "30 1 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
days-before-issue-stale: 120
days-before-issue-close: 14
stale-issue-label: "no-issue-activity"
stale-issue-message: "This issue has been automatically marked as stale because it has not had recent activity. We kindly ask you to check again if the issue you reported is still relevant in the current version of Monkey 365. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions."
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale. If the issue is still relevant, feel free to re-open it or open a new one."
exempt-issue-labels: 'needs-triage,work-in-progress'
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 28fe378

Please sign in to comment.