forked from widelands/widelands
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (90 loc) · 2.71 KB
/
pre-build_checks.yaml
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
name: Pre-Build Documentation and Sanity Checks
on:
workflow_call:
inputs:
clang_tidy:
required: true
type: string
codecheck:
required: true
type: string
jobs:
clang_tidy:
if: ${{ inputs.clang_tidy != 'false' }}
uses: ./.github/workflows/build_clang_tidy.yaml
codecheck:
if: ${{ inputs.codecheck != 'false' }}
uses: ./.github/workflows/build_codecheck.yaml
# This job runs multiple smaller checks where having several jobs would be overkill.
misc_sanity_checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Validate JSON files
run: |
python3 utils/validate_json.py data/txts/
python3 utils/update_authors.py
- name: Check for missing copyright headers
run: |
pushd src
../utils/find_missing_copyright_headers.sh
popd
- name: Check for superfluous includes and forward declarations
run: |
pushd src
../utils/find_unused_includes.py
popd
- name: Check regression test coverage of starting and win conditions
run: |
python3 utils/test/check_template_test_coverage.py
documentation:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Installing python
uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
- name: Install graphviz
run: |
sudo apt-get update
sudo apt-get install graphviz
- name: Generate documentation
run: |
cd doc/sphinx
pip install -r requirements.txt
mkdir source/_static
./extract_rst.py
# Test building for the homepage
sphinx-build -W -b json -d build/doctrees source build/json
# This is suitable for user testing
./make.py html -graphs
# Create a downloadable workflow artifact for testing
mv build widelands-doc-${{ github.sha }}
zip -r ${{ github.workspace }}/Widelands-${{ github.sha }}-Developer-Documentation.zip widelands-doc-${{ github.sha }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Widelands Developer Documentation
path: ${{ github.workspace }}/Widelands-${{ github.sha }}-Developer-Documentation.zip
lua_style:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Prepare documentation examples for parsing
run: |
pushd doc/sphinx
./extract_rst.py
popd
- name: Run Lua style checker
run: ./utils/lua_style_checker.py