Skip to content

Commit

Permalink
Merge pull request #5 from DEVmachine-fr/feature/add-redis-transport
Browse files Browse the repository at this point in the history
Feature/add redis transport
  • Loading branch information
zecit authored Apr 23, 2024
2 parents 564306f + 21fb049 commit 8b05071
Show file tree
Hide file tree
Showing 124 changed files with 4,625 additions and 3,746 deletions.
76 changes: 0 additions & 76 deletions .github/CODE_OF_CONDUCT.md

This file was deleted.

1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
-
package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
commit-message:
prefix: ci
25 changes: 25 additions & 0 deletions .github/linters/.htmlhintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"tagname-lowercase": true,
"attr-lowercase": true,
"attr-value-double-quotes": true,
"attr-value-not-empty": false,
"attr-no-duplication": true,
"doctype-first": false,
"tag-pair": true,
"tag-self-close": false,
"spec-char-escape": true,
"id-unique": true,
"src-not-empty": true,
"title-require": true,
"alt-require": true,
"doctype-html5": true,
"id-class-value": false,
"style-disabled": false,
"inline-style-disabled": false,
"inline-script-disabled": false,
"space-tab-mixed-disabled": "space",
"id-class-ad-disabled": false,
"href-abs-or-rel": false,
"attr-unsafe-chars": true,
"head-script-disabled": true
}
13 changes: 13 additions & 0 deletions .github/linters/.jscpd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"threshold": 0,
"reporters": ["consoleFull"],
"ignore": [
"**/__snapshots__/**",
"**/*_test.go",
"**/examples",
"**/node_modules",
"**/dist",
"**/.goreleaser.yml"
],
"absolute": true
}
36 changes: 36 additions & 0 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
###########################
###########################
## Markdown Linter rules ##
###########################
###########################

# Linter rules doc:
# - https://github.com/DavidAnson/markdownlint
#
# Note:
# To comment out a single error:
# <!-- markdownlint-disable -->
# any violations you want
# <!-- markdownlint-restore -->
#

###############
# Rules by id #
###############
MD004: false # Unordered list style
MD007:
indent: 2 # Unordered list indentation
MD010:
ignore_code_languages: [caddyfile]
MD013: false
MD026:
punctuation: ".,;:!。,;:" # List of not allowed
MD029: false # Ordered list item prefix
MD033: false # Allow inline HTML
MD036: false # Emphasis used instead of a heading

#################
# Rules by tags #
#################
blank_lines: false # Error on blank lines
13 changes: 13 additions & 0 deletions .github/linters/.textlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"filters": {
"comments": true
},
"rules": {
"terminology": {
"defaultTerms": true,
"exclude": [
"(?<=(?:\\w+[^.?!])? )internet\\b(?! explorer)"
]
}
}
}
9 changes: 9 additions & 0 deletions .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
extends: relaxed

rules:
line-length: disable

ignore: |
charts/
chart/
7 changes: 2 additions & 5 deletions .github/workflows/cd-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -20,14 +20,11 @@ jobs:
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0
uses: azure/setup-helm@v4

- name: Run chart-releaser
uses: dunglas/chart-releaser-action@feat/match-tags
with:
charts_repo_url: https://charts.mercure.rocks
match_tags: helm-chart-*
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/cd-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish Docs

on:
push:
branches:
- main
paths:
- docs/**

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Revalidate changed pages
run: |
shopt -s globstar
FILES=$(git --no-pager diff --name-only HEAD~1 -- docs/**/*.md | awk 'BEGIN{RS="\n"} {printf "%s%s",sep,$0; sep="&files="}')
curl --silent --fail-with-body "https://mercure.rocks/api/revalidate?secret=${{ secrets.REVALIDATE_TOKEN }}&files=$FILES"
49 changes: 40 additions & 9 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,66 @@
name: Release Hub

on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- 'v*'
- v*.*.*
workflow_dispatch:
inputs: {}

permissions: write-all
permissions:
contents: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.17'
go-version: '1.22'
cache-dependency-path: |
go.sum
caddy/go.sum
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set GoReleaser Git tags
run: |
tags=$(git tag --list --sort=-version:refname 'v*')
echo "GORELEASER_CURRENT_TAG=$(awk 'NR==1 {print;exit}' <<< "$tags")" >> "$GITHUB_ENV"
echo "GORELEASER_PREVIOUS_TAG=$(awk 'NR==2 {print;exit}' <<< "$tags")" >> "$GITHUB_ENV"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
args: release --clean --timeout 60m ${{ !startsWith(github.ref, 'refs/tags/v') && '--snapshot --skip=sign' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Display version
run: dist/caddy_linux_amd64_v1/mercure version

- name: Upload snapshot
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v4
with:
name: snapshot
path: dist/*
retention-days: 1
34 changes: 21 additions & 13 deletions .github/workflows/ci-chart.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Lint and Test Chart

on: pull_request
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- v*.*.*

jobs:
lint-test:
Expand All @@ -9,36 +17,36 @@ jobs:
CT_TARGET_BRANCH: main
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0
uses: azure/setup-helm@v4

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: '3.10'

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.1.0
uses: helm/chart-testing-action@v2

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
run: ct lint --check-version-increment=false
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --check-version-increment=false --target-branch ${{ github.event.repository.default_branch }}

- name: Create kind cluster
uses: helm/[email protected]
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1

- name: Run chart-testing (install)
run: ct install
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}
Loading

0 comments on commit 8b05071

Please sign in to comment.