Skip to content

Commit

Permalink
snapshot 2023-01-01
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Jan 9, 2023
0 parents commit 74c534a
Show file tree
Hide file tree
Showing 51 changed files with 932 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/actions/notify/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Define notification message
description: Identify an appropriate notification message.
branding:
icon: 'message-square'
color: 'green'

inputs:
emoji:
description: Prefix for the title.
default: 🤖

channel:
description: Notification channel.
required: true

success:
description: Is the result successful?
required: true
default: 'true'

runs:
using: composite
steps:
- name: Define notification message
id: message
run: |
if [ '${{ github.event.head_commit.message != null }}' == 'true' ]
then
(cat <<-message
txt=${{ github.event.head_commit.message }}
message
) | head -1 >> $GITHUB_OUTPUT
elif [ '${{ github.event.inputs.reason != null }}' == 'true' ]
then
(cat <<-message
txt=${{ github.event.inputs.reason }}
message
) | head -1 >> $GITHUB_OUTPUT
elif [ '${{ github.event.schedule != null }}' == 'true' ]
then
echo txt='regular healthcheck' >> $GITHUB_OUTPUT
else
echo Cannot define notification message && exit 1
fi
shell: bash

- name: Send Slack notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ inputs.success == 'true' && 'success' || 'failure' }}
SLACK_FOOTER: made with ❤️ for everyone by <https://www.octolab.org/|OctoLab>
SLACK_ICON: https://cdn.octolab.org/geek/octolab.png
SLACK_MESSAGE: ${{ steps.message.outputs.txt }}
SLACK_TITLE: '${{ inputs.emoji }} ${{ github.repository }}: ${{ github.workflow }}'
SLACK_USERNAME: Notifier
SLACK_WEBHOOK: ${{ inputs.channel }}
41 changes: 41 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: 2

registries:
github:
type: git
url: https://github.com
username: x-access-token
password: ${{ secrets.DEPENDABOT_TOKEN }}

updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
time: '05:00'
timezone: UTC
labels:
- 'type: improvement'
- 'scope: inventory'
- 'scope: deps'
commit-message:
prefix: 'ci/cd'
include: 'scope'
open-pull-requests-limit: 30

- package-ecosystem: gitsubmodule
registries:
- github
directory: /
schedule:
interval: daily
time: '05:00'
timezone: UTC
labels:
- 'type: improvement'
- 'scope: code'
- 'scope: deps'
commit-message:
prefix: 'feat'
include: 'scope'
open-pull-requests-limit: 30
131 changes: 131 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
repository:
has_wiki: false
has_issues: true
has_projects: false

allow_forking: true

allow_auto_merge: false
allow_merge_commit: false
allow_squash_merge: false
allow_rebase_merge: true
allow_update_branch: false
delete_branch_on_merge: true

default_branch: main

enable_vulnerability_alerts: true
enable_automated_security_fixes: true

branches:
- name: main
protection:
required_linear_history: true

labels:
- name: 'type: bug'
color: '#DA0064'
description: |
A new bug report.
- name: 'type: feature'
color: '#9510AC'
description: |
A new feature request.
- name: 'type: improvement'
color: '#0CA789'
description: |
A new improvement proposal.
- name: 'severity: critical'
color: '#F24727'
description: |
A bug has critical severity and needs to be fixed as soon as possible.
- name: 'severity: major'
color: '#EF8D79'
description: |
A bug has major severity and needs to be fixed in the nearest iteration.
- name: 'severity: minor'
color: '#FBC7BD'
description: |
A bug has minor severity and should be fixed when possible.
- name: 'scope: code'
color: '#808080'
description: |
An issue related to source code.
- name: 'scope: deps'
color: '#949494'
description:
An issue related to dependencies.
- name: 'scope: docs'
color: '#ADADAD'
description: |
An issue related to documentation.
- name: 'scope: test'
color: '#D9D9D9'
description: |
An issue related to tests.
- name: 'scope: inventory'
color: '#EAEAEA'
description: |
An issue related to auxiliary code, e.g. CI config, Makefiles, etc.
- name: 'impact: high'
color: '#652CB3'
description: |
An issue has high impact.
- name: 'impact: medium'
color: '#A380D1'
description: |
An issue has medium impact.
- name: 'impact: low'
color: '#CAB9E1'
description: |
An issue has low impact.
- name: 'effort: hard'
color: '#414BB2'
description: |
An issue is hard to implement or reproduce.
- name: 'effort: medium'
color: '#8D93D1'
description: |
An issue has a medium complexity.
- name: 'effort: easy'
color: '#C6C9E8'
description: |
An issue is easy to implement.
- name: 'status: pending'
color: '#2D9BF1'
description: |
Mark an issue as hold.
- name: 'status: stale'
color: '#3A3A3A'
description: |
Mark an issue as stale.
- name: duplicate
color: '#F8961E'
description: |
An issue or pull request already exists.
- name: good first issue
color: '#90BE6D'
description: |
Good for newcomers.
- name: help wanted
color: '#577590'
description: |
Extra attention is needed.
- name: invalid
color: '#F94144'
description: |
This doesn't seem right.
- name: question
color: '#43AA8B'
description: |
Further information is requested.
- name: wontfix
color: '#F9C74F'
description: |
This will not be worked on.
91 changes: 91 additions & 0 deletions .github/workflows/cd.urls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Continuous delivery

on:
push:
branches: [ main ]
paths:
- '.github/workflows/cd.urls.yml'
- 'bin/lib/**/*.bash'
- 'src/**/*'
- 'go.work'
- 'Makefile'
- 'Taskfile'

schedule:
- cron: 0 7 1 * * # at 07:00 on day-of-month 1, UTC

workflow_dispatch:
inputs:
reason:
description: The reason for dispatching it manually.
type: string
default: manual healthcheck
required: true

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
name: Building
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
token: ${{ secrets.DEPENDABOT_TOKEN }}
- name: Install dependencies
run: curl -sSfL https://install.octolab.org/maintainer | sh -s -- -b /usr/local/bin -dx
- name: Set up GitHub Pages
uses: actions/configure-pages@v3
- name: Set up Go environment
uses: actions/setup-go@v4
with: { go-version: 1.21.x, cache-dependency-path: src/*/go.sum, check-latest: true }

- name: Build static HTML
run: make
env:
GITHUB_TOKEN: ${{ secrets.DEPENDABOT_TOKEN }}
- name: Upload the documentation
uses: actions/upload-pages-artifact@v2
with: { path: dist }

deploy:
name: Deploying
needs: [ build ]
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
id-token: write
pages: write

steps:
- name: Deploy it to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

notify:
name: Notifying
needs: [ build, deploy ]
runs-on: ubuntu-latest
if: failure() || success()

steps:
- name: Checkout the repository
uses: actions/checkout@v4
with: { fetch-depth: 0 }

- name: Send notification
uses: ./.github/actions/notify
continue-on-error: true
with:
emoji: 🤴
channel: ${{ secrets.SLACK_WEBHOOK }}
success: ${{ ! contains(needs.*.result, 'failure') }}
52 changes: 52 additions & 0 deletions .github/workflows/cleanup.caches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Workflow caches cleanup

on:
schedule:
- cron: 0 6 1 * * # at 06:00 on day-of-month 1, UTC

workflow_dispatch:
inputs:
reason:
description: The reason for dispatching it manually.
type: string
default: manual healthcheck
required: true

jobs:
delete:
name: Deleting
runs-on: ubuntu-latest

env:
GITHUB_TOKEN: ${{ github.token }}

steps:
- name: Install the GitHub CLI cache extension
run: gh extension install actions/gh-actions-cache

- name: Cleanup caches
run: |
echo Deleting caches...
for key in $(gh actions-cache list -L 100 -R '${{ github.repository }}' | cut -f 1); do
gh actions-cache delete "${key}" -R '${{ github.repository }}' --confirm || true
done
echo Done
notify:
name: Notifying
needs: [ delete ]
runs-on: ubuntu-latest
if: failure() || success()

steps:
- name: Checkout the repository
uses: actions/checkout@v4
with: { fetch-depth: 0 }

- name: Send notification
uses: ./.github/actions/notify
continue-on-error: true
with:
emoji: 🧹
channel: ${{ secrets.SLACK_WEBHOOK }}
success: ${{ ! contains(needs.*.result, 'failure') }}
Loading

0 comments on commit 74c534a

Please sign in to comment.