Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ci: update github action flows to avoid unnecessary run #61

Merged
merged 3 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/qodana_code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,25 @@ on:
- 'releases/*' # The release branches

jobs:
get-changed-files:
runs-on: ubuntu-latest
outputs:
changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
any_changed: ${{ steps.changed-files.outputs.any_changed }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get changed files
uses: tj-actions/changed-files@v45.0.7
id: changed-files
with:
files: |
**/*.{js,jsx,ts,tsx,cjs,mjs,cts,mts}
files_separator: "\n"
- name: Output changed files
run: echo ${{ steps.changed-files.outputs.all_changed_files }}
qodana:
needs: [ get-changed-files ]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -20,6 +38,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
fetch-depth: 0 # a full history is required for pull request analysis
- name: 'Qodana Scan'
if: needs.get-changed-files.outputs.any_changed == 'true'
uses: JetBrains/qodana-action@v2024.3
with:
pr-mode: false
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,28 @@ permissions:
contents: read

jobs:
get-changed-files:
runs-on: ubuntu-latest
outputs:
changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
any_changed: ${{ steps.changed-files.outputs.any_changed }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get changed files
uses: tj-actions/changed-files@v45.0.7
id: changed-files
with:
files: |
src/**/*.{js,jsx,ts,tsx}
files_separator: "\n"
- name: Output changed files
run: echo ${{ steps.changed-files.outputs.all_changed_files }}
test:
needs: [ get-changed-files ]
name: Run test codes
runs-on: ubuntu-latest
if: needs.get-changed-files.outputs.any_changed == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
'*.{ts,tsx}': ['pnpm run lint:check', "bash -c 'pnpm run types:check'", 'pnpm run prettier:check'],
'*.{ts,tsx,mts,cts}': ['pnpm run lint:check', "bash -c 'pnpm run types:check'", 'pnpm run prettier:check'],
'*': ['secretlint'],
};
Loading