Repository navigation
192 lines (170 loc) Β· 8.09 KB
/
Copy pathbuilds.yml
File metadata and controls
192 lines (170 loc) Β· 8.09 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: π₯οΈ Builds
on:
push:
branches: ["master"]
pull_request:
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}|${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions: {}
jobs:
static-checks-builds:
name: π Code style, file formatting, and docs
runs-on: ubuntu-latest
if: github.run_attempt > 1 || github.event_name == 'workflow_dispatch' || !vars.DISABLE_BUILDS
outputs:
changed-files: '"${{ steps.changed-files.outputs.clangd_all_changed_files }}"' # Wrap with quotes to bookend internal quote separators.
sources-changed: ${{ steps.changed-files.outputs.sources_any_changed }}
godot-executable-url: ${{ steps.godot-env.outputs.godot-linux-url }}
godot-templates-url: ${{ steps.godot-env.outputs.godot-template-url }}
godot-version: ${{ steps.godot-env.outputs.godot-version }}
steps:
- name: Checkout project
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
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/
persist-credentials: false
- name: Setup Godot variables
id: godot-env
uses: ./.github/actions/godot-env
- name: Install APT dependencies
uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
with:
packages: libxml2-utils
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
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 prek
if: steps.changed-files.outputs.pre-commit-config_any_changed != 'true'
uses: j178/prek-action@44924fe9ef4a6f88253c4b6b1bf11c689d3ce53d # v3.1.0
env:
CHANGED_FILES: '"${{ steps.changed-files.outputs.pre-commit_all_changed_files }}"' # Wrap with quotes to bookend internal quote separators
with:
extra-args: --files ${{ env.CHANGED_FILES }}
- name: Style checks via prek for all files
if: steps.changed-files.outputs.pre-commit-config_any_changed == 'true'
uses: j178/prek-action@44924fe9ef4a6f88253c4b6b1bf11c689d3ce53d # v3.1.0
- name: Class reference schema checks
run: xmllint --noout --schema extension/doc_tools/class.xsd extension/doc_classes/*.xml
build-master:
name: π οΈ Build
needs: static-checks-builds
if: needs.static-checks-builds.outputs.sources-changed == 'true' || github.event_name != 'pull_request'
permissions:
contents: read
uses: ./.github/workflows/build-matrix.yml
godot-debug-checks:
runs-on: ubuntu-latest
needs: [static-checks-builds, build-master]
name: π Perform Godot Debug Checks
steps:
- name: Checkout project
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
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/
persist-credentials: false
- name: Export game
id: export_game
uses: ./.github/actions/openvic-export
with:
godot-executable-url: ${{ needs.static-checks-builds.outputs.godot-executable-url }}
godot-templates-url: ${{ needs.static-checks-builds.outputs.godot-templates-url }}
export-as-pack: true
export-debug: true
relative-export-path: ./game/export
- name: Check for class reference updates
env:
EXPORT_GAME_OUTPUTS_EXECUTABLE_PATH: ${{ steps.export_game.outputs.executable-path }}
run: |
echo "Running --doctool to see if this changes the public API without updating the documentation."
echo -e "If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.\n\n"
cd game
$EXPORT_GAME_OUTPUTS_EXECUTABLE_PATH --doctool --headless ../extension --gdextension-docs 2>&1 > /dev/null || true
cd ..
git diff --color --exit-code -- '*.xml' && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$'
godot-unit-tests:
runs-on: ubuntu-latest
needs: [static-checks-builds, build-master]
name: π§ͺ Run gdUnit4 unit tests
steps:
- name: Checkout project
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
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/
persist-credentials: false
- name: Download artifact
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
path: game/bin/openvic
pattern: ${{ github.event.repository.name }}-*-extension
merge-multiple: true
- name: Run unit tests
uses: godot-gdunit-labs/gdUnit4-action@e2d9e577efaa91e47930c0833c0953ad375050f8 # v1.4.1
with:
version: installed
godot-version: ${{ needs.static-checks-builds.outputs.godot-version }}
paths: 'res://tests'
project_dir: './game/'
arguments: ${{ runner.debug && '--verbose' || '' }}
export-master:
runs-on: ubuntu-latest
needs: [static-checks-builds, build-master]
name: π¦ Export
steps:
- name: Shallow clone
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
fetch-depth: 1 # See: https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/
persist-credentials: false
- name: Export game
id: export_game
uses: ./.github/actions/openvic-export
with:
godot-executable-url: ${{ needs.static-checks-builds.outputs.godot-executable-url }}
godot-templates-url: ${{ needs.static-checks-builds.outputs.godot-templates-url }}
archive-output: true
- name: Upload artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ github.event.repository.name }}
retention-days: 30
compression-level: 9
if-no-files-found: error
path: |
${{ steps.export_game.outputs.archive-directory }}
merge-library-files:
name: π Merge Library Files
runs-on: ubuntu-latest
needs: [godot-debug-checks, export-master]
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
delete-merged: true
name: ${{ github.event.repository.name }}-extension
pattern: ${{ github.event.repository.name }}-*-extension
validate-master:
name: β
Validate Success
if: always()
needs: [static-checks-builds, build-master, godot-debug-checks, godot-unit-tests, export-master, merge-library-files]
runs-on: Ubuntu-latest
steps:
- name: Check
uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35
with:
allowed-skips: static-checks-builds, build-master, godot-debug-checks, godot-unit-tests, export-master, merge-library-files
jobs: ${{ toJson(needs) }}