Merge pull request #3 from drzo/copilot/create-github-actions-workflows #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop, "copilot/**" ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| workflow_dispatch: | |
| jobs: | |
| # Quick checks that run first | |
| pre-checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Check for merge conflicts | |
| run: | | |
| if git grep -rn "^<<<<<<< " . ; then | |
| echo "Merge conflict markers found!" | |
| exit 1 | |
| fi | |
| - name: Check file permissions | |
| run: | | |
| if find . -name "*.el" -executable -type f | grep -q .; then | |
| echo "Found executable .el files (should not be executable)" | |
| find . -name "*.el" -executable -type f | |
| exit 1 | |
| fi | |
| - name: Check for large files | |
| run: | | |
| large_files=$(find . -type f -size +1M -not -path "*/\.*" -not -path "*/node_modules/*") | |
| if [ -n "$large_files" ]; then | |
| echo "Warning: Large files found:" | |
| echo "$large_files" | |
| fi | |
| continue-on-error: true | |
| # Note: The individual workflows (elisp-compile.yml, elisp-lint.yml, etc.) | |
| # will run automatically based on their own triggers. | |
| # This pipeline provides a unified view and summary. | |
| # Quick checks that can run in parallel | |
| quick-checks: | |
| runs-on: ubuntu-latest | |
| needs: pre-checks | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Verify workflow files | |
| run: | | |
| echo "Checking workflow syntax..." | |
| for file in .github/workflows/*.yml; do | |
| python3 -c "import yaml; yaml.safe_load(open('$file'))" && \ | |
| echo "✓ $(basename $file)" || \ | |
| (echo "✗ $(basename $file)" && exit 1) | |
| done | |
| - name: Check file structure | |
| run: | | |
| echo "Verifying repository structure..." | |
| [ -f "Cask" ] && echo "✓ Cask file exists" | |
| [ -f "package.json" ] && echo "✓ package.json exists" | |
| [ -f "README.org" ] && echo "✓ README.org exists" | |
| echo "Repository structure verified" | |
| # Final summary | |
| ci-summary: | |
| runs-on: ubuntu-latest | |
| needs: [quick-checks] | |
| if: always() | |
| steps: | |
| - name: CI Summary | |
| run: | | |
| echo "CI Pipeline Summary:" | |
| echo "===================" | |
| echo "Pre-checks: ${{ needs.pre-checks.result }}" | |
| echo "Quick-checks: ${{ needs.quick-checks.result }}" | |
| echo "" | |
| echo "Note: Individual workflows (elisp-lint, elisp-compile, elisp-test," | |
| echo "org-mode-validation, javascript-ci, documentation-check, code-quality," | |
| echo "and security-scan) run independently based on their file path triggers." | |
| echo "" | |
| echo "Check the Actions tab to see status of all workflows." | |
| - name: Report success | |
| if: success() | |
| run: | | |
| echo "✓ CI Pipeline checks passed!" | |
| echo "Individual workflows will run based on changed files." |