-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (57 loc) · 1.92 KB
/
check-code.yaml
File metadata and controls
65 lines (57 loc) · 1.92 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Check Code Changes
on:
workflow_call:
env:
WORKFLOW_FILEPATH: .github/workflows/check-code.yaml
jobs:
ruff:
name: Run Ruff
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check for Changed Files
id: check
uses: obsproject/obs-studio/.github/actions/check-changes@19646f9434857120625524fbf15f254efa1afecc
with:
checkGlob: "'${{ env.WORKFLOW_FILEPATH }}' '*.py'"
diffFilter: 'ACM'
- name: Lint with Ruff
if: ${{ fromJSON(steps.check.outputs.hasChangedFiles) }}
uses: astral-sh/ruff-action@v3
- name: Format with Ruff
if: ${{ !cancelled() && fromJSON(steps.check.outputs.hasChangedFiles) }}
uses: astral-sh/ruff-action@v3
with:
args: "format --check"
fsdk:
name: Re-sync Freedesktop SDK shared files
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check for Changed Files
id: check
uses: obsproject/obs-studio/.github/actions/check-changes@19646f9434857120625524fbf15f254efa1afecc
with:
checkGlob: "'${{ env.WORKFLOW_FILEPATH }}' 'elements/plugins/*' 'elements/freedesktop-sdk.bst' 'include/strip.yml'"
diffFilter: 'ACM'
- name: Sync shared files
id: sync
if: ${{ fromJSON(steps.check.outputs.hasChangedFiles) }}
uses: ./.github/actions/sync-shared-fsdk-files
- name: Check if files have changed
if: ${{ !cancelled() && fromJSON(steps.check.outputs.hasChangedFiles) }}
shell: bash
run: |
: Check if the element has changed
if [[ -z "$(git status --porcelain)" ]]; then
echo "::notice::Files are in sync"
else
echo "::error::Files are not in sync"
exit 2
fi