-
Notifications
You must be signed in to change notification settings - Fork 2
Add essential GitHub workflows for CI/CD automation #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
dc24099
983fff8
6be7646
90cc66b
c4b831e
3e7a7d7
fb42342
b518bfd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Configuration for PR auto-labeling | ||
| # Labels are applied based on file path patterns | ||
|
|
||
| '📦 dependencies': | ||
| - changed-files: | ||
| - any-glob-to-any-file: ['package.json', 'pnpm-lock.yaml', '**/package.json'] | ||
|
|
||
| '📚 documentation': | ||
| - changed-files: | ||
| - any-glob-to-any-file: ['docs/**/*', '**/*.md', 'README.md'] | ||
|
|
||
| '🔧 tooling': | ||
| - changed-files: | ||
| - any-glob-to-any-file: ['packages/tools/**/*', '.github/**/*', 'scripts/**/*'] | ||
|
|
||
| '🏗️ foundation': | ||
| - changed-files: | ||
| - any-glob-to-any-file: ['packages/foundation/**/*'] | ||
|
|
||
| '🔌 drivers': | ||
| - changed-files: | ||
| - any-glob-to-any-file: ['packages/drivers/**/*'] | ||
|
|
||
| '🚀 runtime': | ||
| - changed-files: | ||
| - any-glob-to-any-file: ['packages/runtime/**/*'] | ||
|
|
||
| '📝 examples': | ||
| - changed-files: | ||
| - any-glob-to-any-file: ['examples/**/*'] | ||
|
|
||
| '⚡ starters': | ||
| - changed-files: | ||
| - any-glob-to-any-file: ['packages/starters/**/*'] | ||
|
|
||
| '🧪 tests': | ||
| - changed-files: | ||
| - any-glob-to-any-file: ['**/*.test.ts', '**/*.spec.ts', '**/jest.config.js'] | ||
|
|
||
| '🔒 security': | ||
| - changed-files: | ||
| - any-glob-to-any-file: ['**/*.permission.yml', '**/security/**/*'] | ||
|
|
||
| '⚙️ configuration': | ||
| - changed-files: | ||
| - any-glob-to-any-file: ['tsconfig*.json', '.gitignore', '.npmrc', 'pnpm-workspace.yaml'] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| name: "CodeQL Security Scan" | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
| schedule: | ||
| # Run every Monday at 00:00 UTC | ||
| - cron: '0 0 * * 1' | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze Code | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| security-events: write | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| language: [ 'javascript' ] | ||
| # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v3 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| # If you want to specify custom queries, add them here | ||
| # queries: security-extended,security-and-quality | ||
|
|
||
| - name: Autobuild | ||
| uses: github/codeql-action/autobuild@v3 | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v3 | ||
| with: | ||
| category: "/language:${{matrix.language}}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: "Dependency Review" | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ "main" ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| dependency-review: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Dependency Review | ||
| uses: actions/dependency-review-action@v4 | ||
| with: | ||
| # Fail the action if vulnerabilities with severity >= moderate are detected | ||
| fail-on-severity: moderate | ||
| # Warn about deprecated packages | ||
| warn-on-deprecated: true | ||
| # Comment on the PR with the review results | ||
| comment-summary-in-pr: on-failure |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: "Pull Request Labeler" | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| labeler: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run Labeler | ||
| uses: actions/labeler@v5 | ||
| with: | ||
| repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
| configuration-path: .github/labeler.yml | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: "Stale Issue Management" | ||
|
|
||
| on: | ||
| schedule: | ||
| # Run every day at 00:00 UTC | ||
| - cron: '0 0 * * *' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| issues: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| stale: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Mark/Close Stale Issues and PRs | ||
| uses: actions/stale@v9 | ||
| with: | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| # Issues | ||
| stale-issue-message: > | ||
| This issue has been automatically marked as stale because it has not had | ||
| recent activity. It will be closed in 14 days if no further activity occurs. | ||
| Thank you for your contributions. | ||
| close-issue-message: > | ||
| This issue was automatically closed because it has not had activity for 74 days | ||
| (marked stale after 60 days, then closed after 14 more days of inactivity). | ||
| Please feel free to reopen if you believe this issue is still relevant. | ||
| days-before-issue-stale: 60 | ||
| days-before-issue-close: 14 | ||
| stale-issue-label: 'stale' | ||
| exempt-issue-labels: 'pinned,security,roadmap,help wanted' | ||
|
|
||
| # Pull Requests | ||
| stale-pr-message: > | ||
| This pull request has been automatically marked as stale because it has not had | ||
| recent activity. It will be closed in 7 days if no further activity occurs. | ||
| Please address any review comments or conflicts. | ||
| close-pr-message: > | ||
| This pull request was automatically closed because it has not had activity for 37 days | ||
| (marked stale after 30 days, then closed after 7 more days of inactivity). | ||
| Please feel free to reopen and address the review comments if you wish to continue. | ||
| days-before-pr-stale: 30 | ||
| days-before-pr-close: 7 | ||
| stale-pr-label: 'stale' | ||
| exempt-pr-labels: 'pinned,security,in progress' | ||
|
|
||
| # General settings | ||
| operations-per-run: 100 | ||
| remove-stale-when-updated: true | ||
| ascending: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Type Check | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
|
|
||
| jobs: | ||
| typecheck: | ||
| name: TypeScript Type Check | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: pnpm/action-setup@v3 | ||
| with: | ||
| version: 10 | ||
|
|
||
| - name: Use Node.js 20.x | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20.x | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
| timeout-minutes: 5 | ||
|
|
||
| - name: Run TypeScript type check | ||
| run: | | ||
| echo "Running TypeScript compiler in build mode for type checking..." | ||
| pnpm tsc -b | ||
| timeout-minutes: 5 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: Validate Metadata Files | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| paths: | ||
| - '**/*.object.yml' | ||
| - '**/*.validation.yml' | ||
| - '**/*.permission.yml' | ||
| - '**/*.app.yml' | ||
| - '**/*.page.yml' | ||
| - '**/*.menu.yml' | ||
| - 'scripts/validate-yaml.js' | ||
| pull_request: | ||
| branches: [ "main" ] | ||
| paths: | ||
| - '**/*.object.yml' | ||
| - '**/*.validation.yml' | ||
| - '**/*.permission.yml' | ||
| - '**/*.app.yml' | ||
| - '**/*.page.yml' | ||
| - '**/*.menu.yml' | ||
| - 'scripts/validate-yaml.js' | ||
|
|
||
| jobs: | ||
| validate: | ||
| name: Validate YAML Metadata | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: pnpm/action-setup@v3 | ||
| with: | ||
| version: 10 | ||
|
|
||
| - name: Use Node.js 20.x | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20.x | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
| timeout-minutes: 5 | ||
|
|
||
| - name: Validate YAML syntax | ||
| run: | | ||
| echo "Checking YAML syntax for metadata files..." | ||
| pnpm exec node scripts/validate-yaml.js | ||
|
Comment on lines
+48
to
+51
|
||
| timeout-minutes: 5 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow should be triggered when the labeler configuration file changes. Add a trigger for changes to '.github/labeler.yml' so that configuration updates are validated automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
.github/labeler.ymlto the paths filter so configuration changes trigger the labeler workflow for validation. (3e7a7d7)