diff --git a/.commitlintrc.json b/.commitlintrc.json new file mode 100644 index 0000000..8957319 --- /dev/null +++ b/.commitlintrc.json @@ -0,0 +1,15 @@ +{ + "extends": ["@commitlint/config-conventional"], + "rules": { + "type-enum": [ + 2, + "always", + ["feat", "fix", "sec", "test", "refactor", "chore", "docs", "ci"] + ], + "scope-enum": [ + 2, + "always", + ["backend", "frontend", "iot", "ci", "deps", "core"] + ] + } +} \ No newline at end of file diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 34edb91..793c1a0 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -20,6 +20,9 @@ jobs: steps: - name: Checkout Source Code uses: actions/checkout@v3 + - name: Validate Commit Messages + uses: wagoid/commitlint-github-action@v5 + - name: Setup Python Environment uses: actions/setup-python@v4 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f8f0cef..e5d5b92 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,6 +29,8 @@ jobs: # Step 1: Check out the repository code. - name: Checkout repository uses: actions/checkout@v4 + - name: Validate Commit Messages + uses: wagoid/commitlint-github-action@v5 # Step 2: Authenticate with the GitHub Container Registry. - name: Log in to the Container Registry diff --git a/.github/workflows/devops-ci.yml b/.github/workflows/devops-ci.yml new file mode 100644 index 0000000..e20d15f --- /dev/null +++ b/.github/workflows/devops-ci.yml @@ -0,0 +1,22 @@ +name: DevOps CI + +on: + push: + branches: [ "main", "develop" ] + paths: + - '.github/workflows/**' + pull_request: + branches: [ "main" ] + paths: + - '.github/workflows/**' + +jobs: + actionlint: + name: Validate GitHub Actions Workflows + runs-on: ubuntu-latest + steps: + - name: Checkout Source Code + uses: actions/checkout@v3 + + - name: Run Actionlint + uses: reviewdog/action-actionlint@v1 \ No newline at end of file diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml index b58001c..23bd335 100644 --- a/.github/workflows/frontend-ci.yml +++ b/.github/workflows/frontend-ci.yml @@ -20,6 +20,8 @@ jobs: steps: - name: Checkout Source Code uses: actions/checkout@v3 + - name: Validate Commit Messages + uses: wagoid/commitlint-github-action@v5 - name: Setup Node.js Environment uses: actions/setup-node@v3 diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml new file mode 100644 index 0000000..97648a0 --- /dev/null +++ b/.github/workflows/pr-lint.yml @@ -0,0 +1,27 @@ +name: PR Lint + +on: + pull_request: + types: + - opened + - edited + - synchronize + +jobs: + pr-title-validation: + name: Validate PR Title + runs-on: ubuntu-latest + steps: + - name: Semantic PR Check + uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + scopes: | + backend + frontend + iot + ci + deps + core + requireScope: true \ No newline at end of file