Skip to content

Commit

Permalink
Merge pull request #2 from hoverkraft-tech/ci/first-implem
Browse files Browse the repository at this point in the history
ci: first implementation
  • Loading branch information
fredleger authored Dec 28, 2024
2 parents 4901181 + 4d14b8a commit 8e2278d
Show file tree
Hide file tree
Showing 11 changed files with 457 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These are supported funding model platforms

github:
- fredleger
- neilime
patreon: webofmars
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

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

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Kubernetes (please complete the following information):**
- Kubernetes version [`kubectl version --short`]

**HRE pod logs**
`kubectl logs hre-xxxxxxx`

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

---

**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.
34 changes: 34 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# .github/dependabot.yml
version: 2
updates:

- package-ecosystem: "github-actions"
directories:
- "/"
open-pull-requests-limit: 3
labels:
- "github_actions"
schedule:
interval: "weekly"
day: friday
time: '04:00'

- package-ecosystem: "docker"
directory: "/"
open-pull-requests-limit: 3
labels:
- "docker"
schedule:
interval: "weekly"
day: friday
time: '04:10'

- package-ecosystem: "pip"
directory: "/"
open-pull-requests-limit: 3
labels:
- "pip"
schedule:
interval: "weekly"
day: friday
time: '04:20'
78 changes: 78 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
template: |
## What's Changed
$CHANGES
## Full Changelog
- https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION
name-template: "Version $RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"

categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'feat'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
- title: '📚 Documentation'
label: 'docs'
- title: '🧪 Tests'
label: 'test'
- title: '🏷️ Version Tags'
label: 'version'
- title: '🔖 Release Tags'
label: 'release'
- title: '🧩 Dependencies'
label: 'dependencies'
- title: '🔒 Security'
label: 'security'
- title: '🚨 Breaking Changes'
label: 'breaking'
- title: '🧹 Code Cleanup'
label: 'cleanup'
- title: '🔧 Config'
label: 'config'
- title: '📦 Packages'
label: 'package'
- title: '🔥 Removals'
label: 'removal'
- title: '🚧 Work In Progress'
label: 'wip'
- title: '🔀 Merges'
label: 'merge'
- title: '🎨 Style'
label: 'style'
- title: '🔊 Logging'
label: 'logging'
- title: '🔇 Silence'
label: 'silence'
- title: '🤖 CI/CD'
label: 'ci'

version-resolver:
major:
labels:
- "release-major"
minor:
labels:
- "release-minor"
patch:
labels:
- "release-patch"
default: patch

autolabeler:
- label: "release-major"
title:
- "/^BREAKING CHANGE:/"
- label: "release-minor"
title:
- "/^feat:/"
- "/^feat\\(.+\\):/"
57 changes: 57 additions & 0 deletions .github/workflows/__shared-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Internal - Common Continuous Integration tasks

on:
workflow_call:
inputs:
tag:
description: "Tag Version (semver - x.x.x)"
type: string
required: false
outputs:
built-images:
value: ${{ jobs.docker-build-images.outputs.built-images }}

jobs:

chart-testing:
name: "Tests: helm chart"
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install tools with asdf
uses: asdf-vm/actions/install@v3
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "INFO: The chart has changes compared to the default branch"
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "INFO: The chart has no changes compared to the default branch"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: |
ct install \
--target-branch ${{ github.event.repository.default_branch }} \
--wait"
- name: show pods
if: steps.list-changed.outputs.changed == 'true'
run: |
sleep 10
kubectl get pods -A
27 changes: 27 additions & 0 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Main - Continuous Integration

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:

ci:
name: Continuous Integration
uses: ./.github/workflows/__shared-ci.yml
permissions:
actions: write
contents: read
id-token: write
issues: read
packages: write
pull-requests: read
secrets: inherit
37 changes: 37 additions & 0 deletions .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Pull request - Continuous Integration

on:
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

pull-request-labeler:
name: Pull request labeler
runs-on: self-hosted
permissions:
contents: write
pull-requests: write
steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
disable-releaser: true

ci:
name: Continuous Integration
uses: ./.github/workflows/__shared-ci.yml
permissions:
actions: write
contents: read
id-token: write
issues: read
packages: write
pull-requests: read
secrets: inherit
Loading

0 comments on commit 8e2278d

Please sign in to comment.