Skip to content

Commit

Permalink
OPSEXP-1793 Dedicated pre-commit workflow to avoid duplicated configs (
Browse files Browse the repository at this point in the history
…#788)

[actions skip]
  • Loading branch information
gionn authored and alxgomz committed Jan 23, 2024
1 parent 08f31db commit d984d68
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 90 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/docker-compose-community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,10 @@ on:
- 'docker-compose/community-docker-compose.yml'
- 'test/postman/docker-compose/**'
- '.github/workflows/community-compose.yml'
- '.pre-commit-config.d/docker.yaml'
push:
branches:
- 'master'
jobs:
pre_commit:
name: Run pre-commit compose checks
runs-on: ubuntu-latest
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v1.17.0
with:
pre-commit-all-files: false
pre-commit-args: -c .pre-commit-config.d/docker.yaml
compose_community:
name: docker-compose community
runs-on: ubuntu-latest
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/docker-compose-enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,10 @@ on:
- 'docker-compose/**'
- 'test/postman/docker-compose/**'
- '.github/workflows/enterprise-compose.yml'
- '.pre-commit-config.d/docker.yaml'
push:
branches:
- 'master'
jobs:
pre_commit:
name: Run pre-commit compose checks
runs-on: ubuntu-latest
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v1.17.0
with:
pre-commit-all-files: false
pre-commit-args: -c .pre-commit-config.d/docker.yaml
compose_enterprise:
name: docker-compose enterprise
strategy:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/helm-community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
- 'helm/**'
- 'test/postman/helm/**'
- '.github/workflows/helm*'
- '.pre-commit-config.d/helm.yaml'
push:
branches:
- 'master'
Expand All @@ -20,14 +19,9 @@ jobs:
app_charts: ${{ steps.getcharts.outputs.app }}
lib_charts: ${{ steps.getcharts.outputs.lib }}
steps:
- uses: >-
Alfresco/alfresco-build-tools/.github/actions/setup-helm-docs@v1.17.0
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v1.17.0
with:
pre-commit-args: -c .pre-commit-config.d/helm.yaml
- id: getcharts
uses: >-
./.github/actions/charts-as-json
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/helm-enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
- 'helm/**'
- 'test/postman/helm/**'
- '.github/workflows/helm*'
- '.pre-commit-config.d/helm.yaml'
push:
branches:
- 'master'
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/pre-commit-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Pre-commit (Docker Compose)

on:
pull_request:
branches:
- "master"
paths:
- "docker-compose/**"
- ".pre-commit-config.yaml"
push:
branches:
- "master"

env:
# https://pre-commit.com/#temporarily-disabling-hooks
SKIP: helm-docs,helm-deps,helm-lint,checkov

jobs:
pre_commit:
name: Run pre-commit
runs-on: ubuntu-latest
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v1.17.0
28 changes: 28 additions & 0 deletions .github/workflows/pre-commit-helm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Pre-commit (Helm)

on:
pull_request:
branches:
- "master"
paths:
- "helm/**"
- "test/postman/helm/**"
- ".github/workflows/helm*"
- "**.md"
- ".pre-commit-config.yaml"
push:
branches:
- "master"

env:
# https://pre-commit.com/#temporarily-disabling-hooks
SKIP: docker-compose-check

jobs:
pre_commit:
name: Run pre-commit
runs-on: ubuntu-latest
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-helm-docs@v1.17.0
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v1.17.0
18 changes: 0 additions & 18 deletions .pre-commit-config.d/docker.yaml

This file was deleted.

31 changes: 0 additions & 31 deletions .pre-commit-config.d/helm.yaml

This file was deleted.

35 changes: 19 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
repos:
- repo: https://github.com/norwoodj/helm-docs
rev: v1.10.0
hooks:
- id: helm-docs
- repo: https://github.com/Alfresco/alfresco-build-tools
rev: v1.6.0
hooks:
- id: helm-deps
- id: helm-lint
# General hooks section
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
Expand All @@ -18,15 +10,26 @@ repos:
- id: check-merge-conflict
- id: fix-byte-order-marker
- id: mixed-line-ending
args: ['--fix=lf']
args: ["--fix=lf"]
- id: end-of-file-fixer
# Helm hooks section (excluded in pre-commit-compose workflow)
- repo: https://github.com/norwoodj/helm-docs
rev: v1.11.0
hooks:
- id: helm-docs
- repo: https://github.com/Alfresco/alfresco-build-tools
rev: v1.18.1
hooks:
- id: helm-deps
- id: helm-lint
- repo: https://github.com/bridgecrewio/checkov.git
rev: 2.1.275
hooks:
- id: checkov
files: \.yaml$
# Docker Compose hooks section (excluded in pre-commit-helm workflow)
- repo: https://github.com/IamTheFij/docker-pre-commit
rev: v2.1.0
rev: v2.1.1
hooks:
- id: docker-compose-check
exclude: override-docker-compose.yml
- repo: https://github.com/bridgecrewio/checkov.git
rev: 2.0.1211
hooks:
- id: checkov
files: \.yaml$

0 comments on commit d984d68

Please sign in to comment.