Skip to content

Commit

Permalink
[CHORE] adding workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Takashi <[email protected]>
  • Loading branch information
nicolastakashi committed Aug 28, 2023
1 parent aec6474 commit f575ca5
Show file tree
Hide file tree
Showing 8 changed files with 236 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Bug report
description: Create a report to help us improve.
body:
- type: markdown
attributes:
value: |
Thank you for opening a bug report for Perses.
Please do *NOT* ask support questions in Github issues.
If your issue is not a feature request or bug report use [Discussions](https://github.com/perses/perses/discussions).
- type: textarea
attributes:
label: What did you do?
description: Please provide steps for us to reproduce this issue.
validations:
required: true
- type: textarea
attributes:
label: What did you expect to see?
- type: textarea
attributes:
label: What did you see instead? Under which circumstances?
validations:
required: true
- type: markdown
attributes:
value: |
## Environment
- type: input
attributes:
label: System information
description: insert output of `uname -srm` here, or operating system version
placeholder: e.g. Linux 5.16.15 x86_64
- type: textarea
attributes:
label: Perses version
description: Insert the Perses version here.
render: text
placeholder: |
e.g. 0.39.0
- type: textarea
attributes:
label: Perses configuration file
description: Insert relevant configuration here. Don't forget to remove secrets.
render: yaml
- type: textarea
attributes:
label: Logs
description: Insert Perses logs relevant to the issue here.
render: text
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
blank_issues_enabled: false
contact_links:
- name: Perses Discussions
url: https://github.com/perses/perses/discussions
- name: Perses Public Channel
url: https://matrix.to/#/!mnvXmsFzbmKXoBYGcv:matrix.org?via=matrix.org
about: If you need help or support, please request help here
- name: Perses Development Channel
url: https://matrix.to/#/#perses-dev:matrix.org
about: If you are unsure about what to do, and you are eager to contribute, you can reach us on this development channel
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Feature request
description: Suggest an idea for this project.
body:
- type: markdown
attributes:
value: |
Thank you for opening a feature request for Perses.
Please do *NOT* ask support questions in Github issues.
If your issue is not a feature request or bug report use [Discussions](https://github.com/perses/perses/discussions).
- type: textarea
attributes:
label: Proposal
description: Use case. Why is this important?
validations:
required: true
22 changes: 22 additions & 0 deletions .github/actions/setup_environment/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Setup environment"
description: "Setup GO or NPM environment"
inputs:
enable_go:
description: Whether to enable go specific features, such as caching.
default: "false"
enable_npm:
description: Whether to enable npm specific features, such as caching.
default: "false"
runs:
using: composite
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
27 changes: 27 additions & 0 deletions .github/actions/setup_helmlint/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Setup
description: sets up helm lint and testing environment
inputs:
create-kind-cluster: # id of input
description: "Whether or not to create a kind cluster during setup"
required: true
default: "false"
runs:
using: "composite"
steps:
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.9.0

- uses: actions/setup-python@v4
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/[email protected]

- name: Create kind cluster
uses: helm/[email protected]
if: ${{ inputs.create-kind-cluster == 'true' }}
with:
node_image: kindest/node:v1.24.12
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--
See the contributing guide for detailed guidance about contributing.
https://github.com/perses/perses/blob/main/CONTRIBUTING.md
-->

# Description

<!-- Context useful to a reviewer -->

# Checklist

- [ ] Pull request has a descriptive title and context useful to a reviewer.
- [ ] Pull request title follows the `[<catalog_entry>] <commit message>` naming convention using one of the following `catalog_entry` values: `FEATURE`, `ENHANCEMENT`, `BUGFIX`, `BREAKINGCHANGE`, `IGNORE`.
- [ ] All commits have [DCO signoffs](https://github.com/probot/dco#how-it-works).
36 changes: 36 additions & 0 deletions .github/workflows/lint-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: lint and test

on:
pull_request:
paths:
- "charts/perses/**"
branches:
- main

jobs:
helm-lint-and-test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: setup helm lint requirements
uses: ./.github/actions/setup_helmlint
with:
create-kind-cluster: "true"

- name: setup go lang
uses: ./.github/actions/setup_environment
with:
enable_go: true

- name: run chart-testing (install)
run: ct install --charts charts/perses

- name: install mdox
run: go install github.com/bwplotka/mdox@latest

- name: run chart README lint
run: make update-helm-readme && make checkdocs
57 changes: 57 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: release

on:
push:
paths:
- "charts/perses/**"
branches:
- main

jobs:
release:
permissions:
contents: write # to push chart release and create a release (helm/chart-releaser-action)
packages: write # needed for ghcr access
id-token: write # needed for keyless signing

runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Fetch history
run: git fetch --prune --unshallow

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Set up Helm
uses: azure/[email protected]

- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_GENERATE_RELEASE_NOTES: true

# see https://github.com/helm/chart-releaser/issues/183
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push charts to GHCR
run: |
shopt -s nullglob
for pkg in .cr-release-packages/*; do
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts"
done

0 comments on commit f575ca5

Please sign in to comment.