Repository navigation
feat: Optimize CI workflows with path filters and move devcontainer docs #267
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 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/ci.yml Line 213 in 4357ed0
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/ci.yml Line 213 in 4357ed0
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/ci.yml Line 213 in 4357ed0
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/ci.yml Line 213 in 4357ed0
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/ci.yml Line 213 in 4357ed0
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/ci.yml Line 213 in 4357ed0
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/ci.yml Line 213 in 4357ed0
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/ci.yml Line 213 in 4357ed0
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶 config/.github/workflows/ci.yml Line 213 in 4357ed0
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,18 +2,82 @@ name: CI | |
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - '**.js' | ||
| - '**.ts' | ||
| - '**.mjs' | ||
| - '**.cjs' | ||
| - '**.json' | ||
| - '**.sh' | ||
| - '**.bats' | ||
| - '.github/workflows/**' | ||
| - 'package.json' | ||
| - 'package-lock.json' | ||
| - '.eslintrc.*' | ||
| - '.prettierrc.*' | ||
| - 'tsconfig.json' | ||
| push: | ||
| branches: [main, master] | ||
| paths: | ||
| - '**.js' | ||
| - '**.ts' | ||
| - '**.mjs' | ||
| - '**.cjs' | ||
| - '**.json' | ||
| - '**.sh' | ||
| - '**.bats' | ||
| - '.github/workflows/**' | ||
| - 'package.json' | ||
| - 'package-lock.json' | ||
| - '.eslintrc.*' | ||
| - '.prettierrc.*' | ||
| - 'tsconfig.json' | ||
|
Comment on lines
+5
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Workflow-level path filters are broader than job-level filters. The workflow-level
This creates unnecessary workflow runs with no actual CI execution. Consider removing workflow-level path filtersSince you're using job-level filtering with on:
pull_request:
- paths:
- - '**.js'
- - '**.ts'
- - '**.mjs'
- - '**.cjs'
- - '**.json'
- - '**.sh'
- - '**.bats'
- - '.github/workflows/**'
- - 'package.json'
- - 'package-lock.json'
- - '.eslintrc.*'
- - '.prettierrc.*'
- - 'tsconfig.json'
push:
branches: [main, master]
- paths:
- - '**.js'
- - '**.ts'
- - '**.mjs'
- - '**.cjs'
- - '**.json'
- - '**.sh'
- - '**.bats'
- - '.github/workflows/**'
- - 'package.json'
- - 'package-lock.json'
- - '.eslintrc.*'
- - '.prettierrc.*'
- - 'tsconfig.json'The
🤖 Prompt for AI Agents |
||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| changes: | ||
| name: Detect Changes | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| outputs: | ||
| code: ${{ steps.filter.outputs.code }} | ||
| scripts: ${{ steps.filter.outputs.scripts }} | ||
| workflows: ${{ steps.filter.outputs.workflows }} | ||
| dependencies: ${{ steps.filter.outputs.dependencies }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: dorny/paths-filter@v3 | ||
| id: filter | ||
| with: | ||
| filters: | | ||
| code: | ||
| - '**.js' | ||
| - '**.ts' | ||
| - '**.mjs' | ||
| - '**.cjs' | ||
| - 'src/**' | ||
| - 'test/**/*.test.{js,ts}' | ||
| - 'tsconfig.json' | ||
| scripts: | ||
| - '**.sh' | ||
| - 'script/**' | ||
| - 'test/integration/**' | ||
| workflows: | ||
| - '.github/workflows/**' | ||
| dependencies: | ||
| - 'package.json' | ||
| - 'package-lock.json' | ||
|
|
||
| lint: | ||
| name: Lint & Format | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| needs: changes | ||
| if: needs.changes.outputs.code == 'true' || needs.changes.outputs.scripts == 'true' || needs.changes.outputs.dependencies == 'true' | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
|
@@ -41,6 +105,8 @@ jobs: | |
| name: Unit Tests | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| needs: changes | ||
| if: needs.changes.outputs.code == 'true' || needs.changes.outputs.dependencies == 'true' | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
|
@@ -87,6 +153,8 @@ jobs: | |
| name: Integration Tests | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| needs: changes | ||
| if: needs.changes.outputs.scripts == 'true' || needs.changes.outputs.dependencies == 'true' | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
|
@@ -118,6 +186,8 @@ jobs: | |
| name: Workflow Lint | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| needs: changes | ||
| if: needs.changes.outputs.workflows == 'true' | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
|
@@ -131,7 +201,7 @@ jobs: | |
| name: Quality Gate | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| needs: [lint, test, integration-test, actionlint] | ||
| needs: [changes, lint, test, integration-test, actionlint] | ||
| if: always() | ||
| steps: | ||
| - name: Check job results | ||
|
|
@@ -154,9 +224,35 @@ jobs: | |
| env: | ||
| LINT_RESULT: ${{ needs.lint.result }} | ||
| TEST_RESULT: ${{ needs.test.result }} | ||
| INTEGRATION_RESULT: ${{ needs.integration-test.result }} | ||
| ACTIONLINT_RESULT: ${{ needs.actionlint.result }} | ||
| run: | | ||
| if [ "$LINT_RESULT" != "success" ] || [ "$TEST_RESULT" != "success" ]; then | ||
| echo "::error::Quality gate failed - lint or test jobs did not succeed" | ||
| # skipped は成功扱い(該当ファイルの変更がない場合) | ||
| function check_result() { | ||
| local result=$1 | ||
| [[ "$result" == "success" || "$result" == "skipped" ]] | ||
| } | ||
|
|
||
| FAILED=false | ||
| if ! check_result "$LINT_RESULT"; then | ||
| echo "::error::Lint & Format failed" | ||
| FAILED=true | ||
| fi | ||
| if ! check_result "$TEST_RESULT"; then | ||
| echo "::error::Unit Tests failed" | ||
| FAILED=true | ||
| fi | ||
| if ! check_result "$INTEGRATION_RESULT"; then | ||
| echo "::error::Integration Tests failed" | ||
| FAILED=true | ||
| fi | ||
| if ! check_result "$ACTIONLINT_RESULT"; then | ||
| echo "::error::Workflow Lint failed" | ||
| FAILED=true | ||
| fi | ||
|
|
||
| if [ "$FAILED" = true ]; then | ||
| echo "::error::Quality gate failed - one or more jobs did not succeed" | ||
| exit 1 | ||
| fi | ||
|
|
||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/docker-image.yml Line 55 in a97beeb
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/docker-image.yml Line 55 in a97beeb
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/docker-image.yml Line 55 in a97beeb
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶 config/.github/workflows/docker-image.yml Line 55 in a97beeb
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/docker-image.yml Line 97 in a97beeb
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/docker-image.yml Line 97 in a97beeb
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/docker-image.yml Line 97 in a97beeb
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/docker-image.yml Line 97 in a97beeb
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶 config/.github/workflows/docker-image.yml Line 97 in a97beeb
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 config/.github/workflows/docker-image.yml Line 201 in a97beeb
|
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.
🚫 [actionlint] reported by reviewdog 🐶
avoid using deprecated input "fail_on_error" in action "reviewdog/action-actionlint@v1": Deprecated, use
fail_levelinstead [action]config/.github/workflows/ci.yml
Line 198 in 4357ed0