forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (43 loc) · 1.98 KB
/
static_checks.yml
File metadata and controls
47 lines (43 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: 📊 Static Checks
on:
workflow_call:
outputs:
changed-files:
description: A list of changed files.
value: ${{ jobs.static-checks.outputs.changed-files }}
sources-changed:
description: Determines if any source files were changed.
value: ${{ jobs.static-checks.outputs.sources-changed }}
workflow_dispatch:
jobs:
static-checks:
name: Code style, file formatting, and docs
runs-on: ubuntu-24.04
timeout-minutes: 30
outputs:
changed-files: '"${{ steps.changed-files.outputs.everything_all_changed_files }}"' # Wrap with quotes to bookend internal quote separators.
sources-changed: ${{ steps.changed-files.outputs.sources_any_changed }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # Treeless clone. Slightly less performant than a shallow clone, but makes finding diffs instantaneous.
filter: tree:0 # See: https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/
# This needs to happen before Python and npm execution; it must happen before any extra files are written.
- name: .gitignore checks (gitignore_check.sh)
run: |
bash ./misc/scripts/gitignore_check.sh
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v47
with:
safe_output: false # Output passed to environment variable to avoid command injection.
separator: '" "' # To account for paths with spaces, ensure our items are split by quotes internally.
skip_initial_fetch: true
files_yaml_from_source_file: .github/changed_files.yml
- name: Style checks via pre-commit
uses: pre-commit/action@v3.0.1
env:
CHANGED_FILES: '"${{ steps.changed-files.outputs.everything_all_changed_files }}"' # Wrap with quotes to bookend internal quote separators.
with:
extra_args: --files ${{ env.CHANGED_FILES }}