Skip to content

Commit ae02214

Browse files
committed
chore: more efficient github actions because of path selection
1 parent feeb4b0 commit ae02214

9 files changed

Lines changed: 57 additions & 19 deletions

File tree

.github/bin/update_image_tags.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,7 @@ def replace_in_kustomization(content: str, new_tag: str) -> Tuple[str, int]:
107107

108108
if in_images_block:
109109
current_indent = len(line) - len(line.lstrip(" \t"))
110-
if (
111-
images_indent is not None
112-
and current_indent <= images_indent
113-
and line.strip()
114-
):
110+
if images_indent is not None and current_indent <= images_indent and line.strip():
115111
# Left the images block
116112
in_images_block = False
117113
images_indent = None
@@ -133,9 +129,7 @@ def replace_in_readme(content: str, new_tag: str) -> Tuple[str, int]:
133129
- ghcr.io/jeboehm/<name>:latest
134130
- docker.io/jeboehm/<name>:latest
135131
"""
136-
pattern = re.compile(
137-
r"(?P<name>\b(?:(?:ghcr|docker)\.io/)?jeboehm/[\w\-\.]+):latest\b"
138-
)
132+
pattern = re.compile(r"(?P<name>\b(?:(?:ghcr|docker)\.io/)?jeboehm/[\w\-\.]+):latest\b")
139133
new_content, count = pattern.subn(lambda m: f"{m.group('name')}:{new_tag}", content)
140134
return new_content, count
141135

@@ -152,9 +146,7 @@ def main(argv: Sequence[str] | None = None) -> int:
152146
Returns:
153147
Exit code (0 for success)
154148
"""
155-
parser = argparse.ArgumentParser(
156-
description="Update :latest image tags to a specific version"
157-
)
149+
parser = argparse.ArgumentParser(description="Update :latest image tags to a specific version")
158150
parser.add_argument("new_tag", help="New tag to set (e.g., v1.2.3)")
159151
parser.add_argument(
160152
"--dry-run",
@@ -175,9 +167,7 @@ def main(argv: Sequence[str] | None = None) -> int:
175167
replacements = 0
176168
new_content = original
177169

178-
if path.name in {"docker-compose.yml"} or path.match(
179-
"**/deploy/compose/*.yaml"
180-
):
170+
if path.name in {"docker-compose.yml"} or path.match("**/deploy/compose/*.yaml"):
181171
new_content, c = replace_in_compose_yaml(new_content, new_tag)
182172
replacements += c
183173

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
FIX_BIOME_FORMAT=true
2-
FIX_BIOME_LINT=true
31
FIX_ENV=true
42
FIX_JSON=true
53
FIX_JSON_PRETTIER=true
@@ -8,5 +6,6 @@ FIX_MARKDOWN_PRETTIER=true
86
FIX_PYTHON_BLACK=true
97
FIX_PYTHON_ISORT=true
108
FIX_PYTHON_RUFF=true
9+
FIX_PYTHON_RUFF_FORMAT=true
1110
FIX_SHELL_SHFMT=true
1211
FIX_YAML_PRETTIER=true

.github/linters/super-linter.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
DEFAULT_BRANCH=main
2+
VALIDATE_BIOME_FORMAT=false
3+
VALIDATE_BIOME_LINT=false
24
VALIDATE_CHECKOV=false
35
VALIDATE_GITHUB_ACTIONS=false
46
VALIDATE_GITHUB_ACTIONS_ZIZMOR=false
@@ -8,5 +10,6 @@ VALIDATE_KUBERNETES_KUBECONFORM=false
810
VALIDATE_PHP=false
911
VALIDATE_PHP_PHPCS=false
1012
VALIDATE_PHP_PSALM=false
13+
VALIDATE_PYTHON_BLACK=false
1114
VALIDATE_SQLFLUFF=false
1215
VALIDATE_TRIVY=false

.github/workflows/dockerhub.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
- jeboehm/mailserver-web
2222
- jeboehm/mailserver-unbound
2323
- jeboehm/mailserver-ssl
24+
- jeboehm/mailserver-db # deprecated
25+
- jeboehm/mailserver-virus # deprecated
2426
steps:
2527
- name: Checkout
2628
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
@@ -31,4 +33,4 @@ jobs:
3133
password: ${{ secrets.DOCKER_PASSWORD }}
3234
repository: ${{ matrix.repository }}
3335
enable-url-completion: true
34-
short-description: Docker Mailserver based on the famous ISPMail guide
36+
short-description: docker-mailserver is inspired by the renowned ISPMail guide.

.github/workflows/lint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Lint
2+
on:
3+
pull_request:
4+
concurrency:
5+
group: "lint-${{ github.ref }}"
6+
cancel-in-progress: true
7+
jobs:
8+
lint:
9+
permissions:
10+
contents: read
11+
packages: read
12+
statuses: write
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
16+
with:
17+
fetch-depth: 0
18+
- name: Prepare environment
19+
run: grep -v '^#' .github/linters/super-linter.env >> "$GITHUB_ENV"
20+
- name: Super-Linter
21+
uses: super-linter/super-linter@7bba2eeb89d01dc9bfd93c497477a57e72c83240 # v8.2.0
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
name: Application test
22
on:
33
pull_request:
4-
merge_group:
4+
push:
5+
paths:
6+
- ".env.dist"
7+
- "bin/**"
8+
- "deploy/**"
9+
- "docker-compose*.yml"
10+
- "kustomization.yaml"
11+
- "Makefile"
12+
- "target/**"
13+
- "test/**"
514
concurrency:
615
group: "test-${{ github.ref }}"
716
cancel-in-progress: true

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ setup:
6262

6363
.PHONY: lint
6464
lint:
65-
docker run --platform linux/amd64 -e RUN_LOCAL=true --rm --env-file .github/linters/super-linter.env --env-file .github/linters/super-linter-fix.env -v $(PWD):/tmp/lint ghcr.io/super-linter/super-linter:v8.1.0
65+
docker compose -f test/super-linter/compose.yaml run --rm super-linter
6666

6767
.PHONY: kubernetes-deploy-helper
6868
kubernetes-deploy-helper:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ and the documentation [Use another MySQL instance](docs/EXTERNAL_MYSQL.md) for d
108108
- [TLS](docs/TLS.md)
109109
- [External MySQL](docs/EXTERNAL_MYSQL.md)
110110
- [External relay host](docs/RELAYHOST.md)
111+
- [Reverse Proxy](docs/REVERSE_PROXY.md)
111112
- [PHP Sessions](docs/PHP_SESSIONS.md)
112113
- [Developer Guide](docs/DEVELOPMENT.md)
113114

test/super-linter/compose.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
services:
2+
super-linter:
3+
platform: linux/amd64
4+
image: ghcr.io/super-linter/super-linter:v8.2.0
5+
env_file:
6+
- ../../.github/linters/super-linter.env
7+
- ../../.github/linters/super-linter-fix.env
8+
environment:
9+
- RUN_LOCAL=true
10+
volumes:
11+
- ../../:/tmp/lint

0 commit comments

Comments
 (0)