Revise CI workflow and update copyright year
Updated copyright year and modified workflow steps for clarity and functionality. Signed-off-by: Jonathan Miller <jmiller2979@gmail.com>
This commit is contained in:
153
.github/workflows/ci.yml
vendored
153
.github/workflows/ci.yml
vendored
@@ -1,13 +1,12 @@
|
|||||||
# ============================================================================
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
# Copyright (C) 2025 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
#
|
#
|
||||||
# This file is part of a Moko Consulting project.
|
# This file is part of a Moko Consulting project.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 3 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -19,44 +18,41 @@
|
|||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoStandards
|
# DEFGROUP: GitHub.Workflow
|
||||||
# INGROUP: GitHub.Actions.ContinuousIntegration
|
# INGROUP: MokoStandards.CI
|
||||||
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
||||||
# PATH: /.github/workflows/ci.yml
|
# PATH: /.github/workflows/ci.yml
|
||||||
# VERSION: 01.00.00
|
# VERSION: 01.00.00
|
||||||
# BRIEF: Continuous integration governance workflow for standards enforcement.
|
# BRIEF: Continuous integration workflow enforcing repository standards.
|
||||||
# NOTE: Runs on every push. Auto-normalizes YAML tabs to two spaces before validation.
|
# NOTE:
|
||||||
# ============================================================================
|
|
||||||
|
|
||||||
name: Continuous integration
|
name: Continuous Integration
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- dev/**
|
||||||
|
- rc/**
|
||||||
|
- version/**
|
||||||
pull_request:
|
pull_request:
|
||||||
workflow_dispatch:
|
branches:
|
||||||
inputs:
|
- main
|
||||||
auto_fix/tabs:
|
- dev/**
|
||||||
description: "Run scripts/fix/tabs.sh before validation (does not commit changes)"
|
- rc/**
|
||||||
required: false
|
- version/**
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
name: Standards Continuous integration Validation
|
name: Repository Validation Pipeline
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
PROFILE: all
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -64,85 +60,44 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Auto-fix YAML tabs when YAML changes detected
|
- name: Normalize line endings
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' || inputs.auto_fix/tabs }}
|
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
git config --global core.autocrlf false
|
||||||
|
|
||||||
if ! command -v git >/dev/null 2>&1; then
|
- name: Verify script executability
|
||||||
echo "git not available, skipping tab normalization"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Determine change window
|
|
||||||
# - pull_request: compare base SHA to head SHA
|
|
||||||
# - push: compare event.before to event.after (current SHA)
|
|
||||||
if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]; then
|
|
||||||
BASE_SHA="${{ github.event.pull_request.base.sha }}"
|
|
||||||
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
|
|
||||||
RANGE="$BASE_SHA...$HEAD_SHA"
|
|
||||||
elif [ "${GITHUB_EVENT_NAME}" = "push" ]; then
|
|
||||||
BEFORE_SHA="${{ github.event.before }}"
|
|
||||||
AFTER_SHA="${{ github.sha }}"
|
|
||||||
RANGE="$BEFORE_SHA...$AFTER_SHA"
|
|
||||||
else
|
|
||||||
RANGE=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$RANGE" ]; then
|
|
||||||
CHANGED_YAML=$(git diff --name-only "$RANGE" -- '*.yml' '*.yaml' || true)
|
|
||||||
else
|
|
||||||
CHANGED_YAML=$(git ls-files '*.yml' '*.yaml' 2>/dev/null || true)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$CHANGED_YAML" ]; then
|
|
||||||
echo "YAML changes detected. Running fix/tabs.sh"
|
|
||||||
if [ -x "./scripts/fix/tabs.sh" ]; then
|
|
||||||
./scripts/fix/tabs.sh
|
|
||||||
else
|
|
||||||
echo "fix/tabs.sh not present, skipping"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "No YAML changes detected. Skipping fix/tabs.sh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Validate YAML tabs usage
|
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
chmod +x scripts/**/*.sh || true
|
||||||
if [ -x "./scripts/validate/tabs.sh" ]; then
|
|
||||||
./scripts/validate/tabs.sh
|
|
||||||
else
|
|
||||||
echo "validate/tabs.sh not present, skipping"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Validate file paths
|
- name: Required validations
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -e
|
||||||
if [ -x "./scripts/validate/paths.sh" ]; then
|
|
||||||
./scripts/validate/paths.sh
|
|
||||||
else
|
|
||||||
echo "validate/paths.sh not present, skipping"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Validate CHANGELOG governance
|
scripts/validate/manifest.sh
|
||||||
run: |
|
scripts/validate/xml_wellformed.sh
|
||||||
set -euo pipefail
|
|
||||||
if [ -x "./scripts/validate/changelog.sh" ]; then
|
|
||||||
./scripts/validate/changelog.sh
|
|
||||||
else
|
|
||||||
echo "validate/changelog.sh not present, skipping"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Validate Joomla manifests
|
- name: Optional validations
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set +e
|
||||||
if [ -x "./scripts/validate/manifest.sh" ]; then
|
|
||||||
./scripts/validate/manifest.sh
|
|
||||||
else
|
|
||||||
echo "validate/manifest.sh not present, skipping"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Continuous integration completion
|
scripts/validate/changelog.sh
|
||||||
|
scripts/validate/language_structure.sh
|
||||||
|
scripts/validate/license_headers.sh
|
||||||
|
scripts/validate/no_secrets.sh
|
||||||
|
scripts/validate/paths.sh
|
||||||
|
scripts/validate/php_syntax.sh
|
||||||
|
scripts/validate/tabs.sh
|
||||||
|
scripts/validate/version_alignment.sh
|
||||||
|
|
||||||
|
- name: CI summary
|
||||||
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
{
|
||||||
echo "Continuous integration checks completed successfully"
|
echo "### CI Execution Summary"
|
||||||
|
echo ""
|
||||||
|
echo "- Repository: $GITHUB_REPOSITORY"
|
||||||
|
echo "- Branch: $GITHUB_REF_NAME"
|
||||||
|
echo "- Commit: $GITHUB_SHA"
|
||||||
|
echo "- Runner: ubuntu-latest"
|
||||||
|
echo ""
|
||||||
|
echo "CI completed. Review logs above for validation outcomes."
|
||||||
|
} >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
|||||||
Reference in New Issue
Block a user