CI: Backport GitHub Actions setup from master
Removes AppVeyor and all Travis jobs but the iOS one, which hasn't been ported to GitHub Actions yet (should be done soon). Backports new style scripts from `master` branch too to do the same checks.
This commit is contained in:
parent
307bac0757
commit
4567eee79e
18 changed files with 626 additions and 463 deletions
|
@ -1,51 +0,0 @@
|
|||
image: Visual Studio 2019
|
||||
|
||||
platform: x64
|
||||
|
||||
environment:
|
||||
HOME: "%HOMEDRIVE%%HOMEPATH%"
|
||||
PYTHON: C:\Python38
|
||||
SCONS_CACHE_ROOT: "%HOME%\\scons_cache"
|
||||
SCONS_CACHE_LIMIT: 1024
|
||||
OPTIONS: "debug_symbols=no verbose=yes progress=no"
|
||||
EXTRA_ARGS: "warnings=all werror=yes"
|
||||
matrix:
|
||||
- GD_PLATFORM: windows
|
||||
TARGET: release_debug
|
||||
TOOLS: yes
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
init:
|
||||
- ps: if ($env:APPVEYOR_REPO_BRANCH -ne "3.2") { $env:APPVEYOR_CACHE_SKIP_SAVE = "true" }
|
||||
|
||||
cache:
|
||||
- "%SCONS_CACHE_ROOT%"
|
||||
|
||||
install:
|
||||
- SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
|
||||
- pip install -U wheel # needed for pip install scons to work, otherwise a flag is missing
|
||||
- pip install scons # use stable scons
|
||||
- if defined VS call "%VS%" %ARCH% # if defined - so we can also use mingw
|
||||
|
||||
before_build:
|
||||
- echo %GD_PLATFORM%
|
||||
- python --version
|
||||
- scons --version
|
||||
- set "SCONS_CACHE=%SCONS_CACHE_ROOT%\%APPVEYOR_REPO_BRANCH%"
|
||||
|
||||
build_script:
|
||||
- scons platform=%GD_PLATFORM% target=%TARGET% tools=%TOOLS% %OPTIONS% %EXTRA_ARGS%
|
||||
|
||||
after_build:
|
||||
- git rev-parse --short=9 HEAD > VERSION_HASH.txt
|
||||
- set /P VERSION_HASH= < VERSION_HASH.txt
|
||||
- cd bin
|
||||
- mv godot.windows.opt.tools.64.exe godot_%APPVEYOR_REPO_BRANCH%-%VERSION_HASH%_win64.exe
|
||||
- 7z a -mx9 godot_%APPVEYOR_REPO_BRANCH%-%VERSION_HASH%_win64.zip *.exe
|
||||
|
||||
artifacts:
|
||||
- path: bin/godot_${APPVEYOR_REPO_BRANCH}-${VERSION_HASH}_win64.zip
|
||||
name: Win64 release_debug editor build
|
||||
type: zip
|
72
.github/workflows/android_builds.yml
vendored
Normal file
72
.github/workflows/android_builds.yml
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
name: Android Builds
|
||||
on: [push, pull_request]
|
||||
|
||||
# Global Cache Settings
|
||||
env:
|
||||
GODOT_BASE_BRANCH: 3.2
|
||||
SCONS_CACHE_LIMIT: 4096
|
||||
|
||||
jobs:
|
||||
android-template:
|
||||
runs-on: "ubuntu-20.04"
|
||||
|
||||
name: Template (target=release, tools=no)
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# Azure repositories are not reliable, we need to prevent azure giving us packages.
|
||||
- name: Make apt sources.list use the default Ubuntu repositories
|
||||
run: |
|
||||
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
|
||||
sudo apt-get update
|
||||
|
||||
# Install all packages (except scons)
|
||||
- name: Configure dependencies
|
||||
run: |
|
||||
sudo apt-get install openjdk-8-jdk
|
||||
echo "::set-env name=JAVA_HOME::usr/lib/jvm/java-8-openjdk-amd64"
|
||||
|
||||
- name: Install Android SDK and NDK
|
||||
run: |
|
||||
echo "::set-env name=PATH::/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:${PATH}"
|
||||
java -version
|
||||
echo "::set-env name=ANDROID_HOME::$(pwd)/godot-dev/build-tools/android-sdk"
|
||||
echo "::set-env name=ANDROID_NDK_ROOT::$(pwd)/godot-dev/build-tools/android-ndk"
|
||||
misc/ci/android-tools-linux.sh
|
||||
source ~/.bashrc
|
||||
|
||||
# Upload cache on completion and check it out now
|
||||
- name: Load .scons_cache directory
|
||||
id: android-template-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{github.workspace}}/.scons_cache/
|
||||
key: ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
restore-keys: |
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}
|
||||
|
||||
# Use python 3.x release (works cross platform)
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
# Semantic version range syntax or exact version of a Python version
|
||||
python-version: '3.x'
|
||||
# Optional - x64 or x86 architecture, defaults to x64
|
||||
architecture: 'x64'
|
||||
|
||||
# You can test your matrix by printing the current Python version
|
||||
- name: Configuring Python packages
|
||||
run: |
|
||||
python -c "import sys; print(sys.version)"
|
||||
python -m pip install scons
|
||||
python --version
|
||||
scons --version
|
||||
|
||||
- name: Compilation
|
||||
env:
|
||||
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
|
||||
run: |
|
||||
scons -j2 verbose=yes warnings=all werror=yes platform=android target=release tools=no
|
76
.github/workflows/javascript_builds.yml
vendored
Normal file
76
.github/workflows/javascript_builds.yml
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
name: JavaScript Builds
|
||||
on: [push, pull_request]
|
||||
|
||||
# Global Cache Settings
|
||||
env:
|
||||
GODOT_BASE_BRANCH: 3.2
|
||||
SCONS_CACHE_LIMIT: 4096
|
||||
EM_VERSION: latest
|
||||
EM_CACHE_FOLDER: 'emsdk-cache'
|
||||
|
||||
jobs:
|
||||
javascript-template:
|
||||
runs-on: "ubuntu-20.04"
|
||||
name: Template (target=release, tools=no)
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# Azure repositories are not reliable, we need to prevent azure giving us packages.
|
||||
- name: Make apt sources.list use the default Ubuntu repositories
|
||||
run: |
|
||||
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
|
||||
sudo apt-get update
|
||||
|
||||
# Upload cache on completion and check it out now
|
||||
- name: Load .scons_cache directory
|
||||
id: javascript-template-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{github.workspace}}/.scons_cache/
|
||||
key: ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
restore-keys: |
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}
|
||||
|
||||
# Additional cache for Emscripten generated system libraries
|
||||
- name: Load Emscripten cache
|
||||
id: javascript-template-emscripten-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{env.EM_CACHE_FOLDER}}
|
||||
key: ${{env.EM_VERSION}}-${{github.job}}
|
||||
|
||||
# Use python 3.x release (works cross platform)
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
# Semantic version range syntax or exact version of a Python version
|
||||
python-version: '3.x'
|
||||
# Optional - x64 or x86 architecture, defaults to x64
|
||||
architecture: 'x64'
|
||||
|
||||
# You can test your matrix by printing the current Python version
|
||||
- name: Configuring Python packages
|
||||
run: |
|
||||
python -c "import sys; print(sys.version)"
|
||||
python -m pip install scons
|
||||
python --version
|
||||
scons --version
|
||||
|
||||
- name: Set up Emscripten latest
|
||||
uses: mymindstorm/setup-emsdk@v6
|
||||
with:
|
||||
version: ${{env.EM_VERSION}}
|
||||
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
|
||||
|
||||
- name: Verify Emscripten setup
|
||||
run: |
|
||||
emcc -v
|
||||
|
||||
- name: Compilation
|
||||
env:
|
||||
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
|
||||
run: |
|
||||
scons -j2 verbose=yes warnings=all werror=yes platform=javascript target=release tools=no use_closure_compiler=yes
|
117
.github/workflows/linux_builds.yml
vendored
Normal file
117
.github/workflows/linux_builds.yml
vendored
Normal file
|
@ -0,0 +1,117 @@
|
|||
name: Linux Builds
|
||||
on: [push, pull_request]
|
||||
|
||||
# Global Cache Settings
|
||||
env:
|
||||
GODOT_BASE_BRANCH: 3.2
|
||||
SCONS_CACHE_LIMIT: 4096
|
||||
|
||||
jobs:
|
||||
linux-editor:
|
||||
runs-on: "ubuntu-20.04"
|
||||
name: Editor w/ Mono (target=release_debug, tools=yes)
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# Azure repositories are not reliable, we need to prevent azure giving us packages.
|
||||
- name: Make apt sources.list use the default Ubuntu repositories
|
||||
run: |
|
||||
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
|
||||
sudo apt-get update
|
||||
|
||||
# Install all packages (except scons)
|
||||
- name: Configure dependencies
|
||||
run: |
|
||||
sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \
|
||||
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm
|
||||
|
||||
# Upload cache on completion and check it out now
|
||||
- name: Load .scons_cache directory
|
||||
id: linux-editor-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{github.workspace}}/.scons_cache/
|
||||
key: ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
restore-keys: |
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}
|
||||
|
||||
# Use python 3.x release (works cross platform; best to keep self contained in it's own step)
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
# Semantic version range syntax or exact version of a Python version
|
||||
python-version: '3.x'
|
||||
# Optional - x64 or x86 architecture, defaults to x64
|
||||
architecture: 'x64'
|
||||
|
||||
# Setup scons, print python version and scons version info, so if anything is broken it won't run the build.
|
||||
- name: Configuring Python packages
|
||||
run: |
|
||||
python -c "import sys; print(sys.version)"
|
||||
python -m pip install scons
|
||||
python --version
|
||||
scons --version
|
||||
|
||||
# We should always be explicit with our flags usage here since it's gonna be sure to always set those flags
|
||||
- name: Compilation
|
||||
env:
|
||||
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
|
||||
run: |
|
||||
scons -j2 verbose=yes warnings=all werror=yes platform=x11 tools=yes target=release_debug module_mono_enabled=yes mono_glue=no
|
||||
|
||||
linux-template:
|
||||
runs-on: "ubuntu-20.04"
|
||||
name: Template w/ Mono (target=release, tools=no)
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# Azure repositories are not reliable, we need to prevent azure giving us packages.
|
||||
- name: Make apt sources.list use the default Ubuntu repositories
|
||||
run: |
|
||||
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
|
||||
sudo apt-get update
|
||||
|
||||
# Install all packages (except scons)
|
||||
- name: Configure dependencies
|
||||
run: |
|
||||
sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \
|
||||
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm
|
||||
|
||||
# Upload cache on completion and check it out now
|
||||
- name: Load .scons_cache directory
|
||||
id: linux-template-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{github.workspace}}/.scons_cache/
|
||||
key: ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
restore-keys: |
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}
|
||||
|
||||
# Use python 3.x release (works cross platform)
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
# Semantic version range syntax or exact version of a Python version
|
||||
python-version: '3.x'
|
||||
# Optional - x64 or x86 architecture, defaults to x64
|
||||
architecture: 'x64'
|
||||
|
||||
# You can test your matrix by printing the current Python version
|
||||
- name: Configuring Python packages
|
||||
run: |
|
||||
python -c "import sys; print(sys.version)"
|
||||
python -m pip install scons
|
||||
python --version
|
||||
scons --version
|
||||
|
||||
- name: Compilation
|
||||
env:
|
||||
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
|
||||
run: |
|
||||
scons -j2 verbose=yes warnings=all werror=yes platform=x11 target=release tools=no module_mono_enabled=yes mono_glue=no
|
94
.github/workflows/macos_builds.yml
vendored
Normal file
94
.github/workflows/macos_builds.yml
vendored
Normal file
|
@ -0,0 +1,94 @@
|
|||
name: MacOS Builds
|
||||
on: [push, pull_request]
|
||||
|
||||
# Global Cache Settings
|
||||
env:
|
||||
GODOT_BASE_BRANCH: 3.2
|
||||
SCONS_CACHE_LIMIT: 4096
|
||||
|
||||
jobs:
|
||||
macos-editor:
|
||||
runs-on: "macos-latest"
|
||||
|
||||
name: Editor (target=release_debug, tools=yes)
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# Upload cache on completion and check it out now
|
||||
- name: Load .scons_cache directory
|
||||
id: macos-editor-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{github.workspace}}/.scons_cache/
|
||||
key: ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
restore-keys: |
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}
|
||||
|
||||
# Use python 3.x release (works cross platform; best to keep self contained in it's own step)
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
# Semantic version range syntax or exact version of a Python version
|
||||
python-version: '3.x'
|
||||
# Optional - x64 or x86 architecture, defaults to x64
|
||||
architecture: 'x64'
|
||||
|
||||
# Setup scons, print python version and scons version info, so if anything is broken it won't run the build.
|
||||
- name: Configuring Python packages
|
||||
run: |
|
||||
python -c "import sys; print(sys.version)"
|
||||
python -m pip install scons
|
||||
python --version
|
||||
scons --version
|
||||
|
||||
# We should always be explicit with our flags usage here since it's gonna be sure to always set those flags
|
||||
- name: Compilation
|
||||
env:
|
||||
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
|
||||
run: |
|
||||
scons -j2 verbose=yes warnings=all werror=yes platform=osx tools=yes target=release_debug
|
||||
|
||||
macos-template:
|
||||
runs-on: "macos-latest"
|
||||
name: Template (target=release, tools=no)
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# Upload cache on completion and check it out now
|
||||
- name: Load .scons_cache directory
|
||||
id: macos-template-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{github.workspace}}/.scons_cache/
|
||||
key: ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
restore-keys: |
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}
|
||||
|
||||
# Use python 3.x release (works cross platform)
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
# Semantic version range syntax or exact version of a Python version
|
||||
python-version: '3.x'
|
||||
# Optional - x64 or x86 architecture, defaults to x64
|
||||
architecture: 'x64'
|
||||
|
||||
# You can test your matrix by printing the current Python version
|
||||
- name: Configuring Python packages
|
||||
run: |
|
||||
python -c "import sys; print(sys.version)"
|
||||
python -m pip install scons
|
||||
python --version
|
||||
scons --version
|
||||
|
||||
- name: Compilation
|
||||
env:
|
||||
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
|
||||
run: |
|
||||
scons -j2 verbose=yes warnings=all werror=yes platform=osx target=release tools=no
|
32
.github/workflows/static_checks.yml
vendored
Normal file
32
.github/workflows/static_checks.yml
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
name: Static Checks
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
static-checks:
|
||||
name: Static Checks (clang-format, black format, file format, documentation checks)
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -qq dos2unix recode clang-format
|
||||
sudo pip3 install black pygments
|
||||
|
||||
- name: File formatting checks (file_format.sh)
|
||||
run: |
|
||||
bash ./misc/scripts/file_format.sh
|
||||
|
||||
- name: Style checks via clang-format (clang_format.sh)
|
||||
run: |
|
||||
bash ./misc/scripts/clang_format.sh
|
||||
|
||||
- name: Python style checks via black (black_format.sh)
|
||||
run: |
|
||||
bash ./misc/scripts/black_format.sh
|
||||
|
||||
- name: Documentation checks
|
||||
run: |
|
||||
doc/tools/makerst.py --dry-run doc/classes modules
|
|
@ -1,52 +1,45 @@
|
|||
# Engine build CI
|
||||
name: Godot CI
|
||||
|
||||
on:
|
||||
# will build EVERY pull request
|
||||
pull_request:
|
||||
|
||||
# will only build explicit branches
|
||||
push:
|
||||
branches: [ master, 3.2, 3.1, 3.0 ]
|
||||
name: Windows Builds
|
||||
on: [push, pull_request]
|
||||
|
||||
# Global Cache Settings
|
||||
# SCONS_CACHE for windows must be set in the build environment
|
||||
env:
|
||||
GODOT_BASE_BRANCH: 3.2
|
||||
SCONS_CACHE_MSVC_CONFIG: true
|
||||
SCONS_CACHE_LIMIT: 8192
|
||||
SCONS_CACHE_LIMIT: 4096
|
||||
|
||||
jobs:
|
||||
windows-editor:
|
||||
# Windows 10 with latest image
|
||||
runs-on: "windows-latest"
|
||||
|
||||
# Windows Editor - checkout with the plugin
|
||||
name: Windows Editor (target=release_debug, tools=yes)
|
||||
name: Editor (target=release_debug, tools=yes)
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# Upload cache on completion and check it out now
|
||||
# Editing this is pretty dangerous for windows since it can break and needs properly tested with a fresh cache.
|
||||
# Linux with this will work reliably, so not as bad to edit for Linux.
|
||||
# Upload cache on completion and check it out now
|
||||
# Editing this is pretty dangerous for Windows since it can break and needs to be properly tested with a fresh cache.
|
||||
- name: Load .scons_cache directory
|
||||
id: windows-editor-cache
|
||||
uses: RevoluPowered/cache@v2.1
|
||||
with:
|
||||
path: /.scons_cache/
|
||||
key: ${{runner.os}}-editor-${{github.sha}}
|
||||
key: ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
restore-keys: |
|
||||
${{runner.os}}-editor-${{github.sha}}
|
||||
${{runner.os}}-editor
|
||||
${{runner.os}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}
|
||||
|
||||
# Use python 3.x release (works cross platform; best to keep self contained in it's own step)
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
# Semantic version range syntax or exact version of a Python version
|
||||
python-version: '3.x'
|
||||
python-version: '3.x'
|
||||
# Optional - x64 or x86 architecture, defaults to x64
|
||||
architecture: 'x64'
|
||||
architecture: 'x64'
|
||||
|
||||
# Setup scons, print python version and scons version info, so if anything is broken it won't run the build.
|
||||
- name: Configuring Python packages
|
||||
|
@ -72,36 +65,34 @@ jobs:
|
|||
# name: windows-editor (x64)
|
||||
# path: bin/godot.windows.opt.tools.64.exe
|
||||
|
||||
|
||||
windows-template:
|
||||
runs-on: "windows-latest"
|
||||
name: Windows Template (target=release, tools=no)
|
||||
name: Template (target=release, tools=no)
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# Upload cache on completion and check it out now
|
||||
# Editing this is pretty dangerous for windows since it can break and needs properly tested with a fresh cache.
|
||||
# Linux with this will work reliably, so not as bad to edit for Linux.
|
||||
# Editing this is pretty dangerous for Windows since it can break and needs to be properly tested with a fresh cache.
|
||||
- name: Load .scons_cache directory
|
||||
id: windows-template-cache
|
||||
uses: RevoluPowered/cache@v2.1
|
||||
with:
|
||||
path: /.scons_cache/
|
||||
key: ${{runner.os}}-template-${{github.sha}}
|
||||
key: ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
restore-keys: |
|
||||
${{runner.os}}-template-${{github.sha}}
|
||||
${{runner.os}}-template
|
||||
${{runner.os}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
|
||||
${{github.job}}-${{env.GODOT_BASE_BRANCH}}
|
||||
|
||||
# Use python 3.x release (works cross platform)
|
||||
# Use python 3.x release (works cross platform)
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
# Semantic version range syntax or exact version of a Python version
|
||||
python-version: '3.x'
|
||||
python-version: '3.x'
|
||||
# Optional - x64 or x86 architecture, defaults to x64
|
||||
architecture: 'x64'
|
||||
architecture: 'x64'
|
||||
|
||||
# You can test your matrix by printing the current Python version
|
||||
- name: Configuring Python packages
|
||||
|
@ -110,6 +101,7 @@ jobs:
|
|||
python -m pip install scons pywin32
|
||||
python --version
|
||||
scons --version
|
||||
|
||||
- name: Compilation
|
||||
env:
|
||||
SCONS_CACHE: /.scons_cache/
|
127
.travis.yml
127
.travis.yml
|
@ -3,16 +3,11 @@ language: cpp
|
|||
# OS config, depends on actual 'os' in build matrix
|
||||
dist: xenial
|
||||
|
||||
stages:
|
||||
- check
|
||||
- build
|
||||
|
||||
env:
|
||||
global:
|
||||
- SCONS_CACHE=$HOME/.scons_cache/$TRAVIS_BRANCH
|
||||
- SCONS_CACHE_LIMIT=1024
|
||||
- OPTIONS="debug_symbols=no verbose=yes progress=no builtin_libpng=yes"
|
||||
- secure: "uch9QszCgsl1qVbuzY41P7S2hWL2IiNFV4SbAYRCdi0oJ9MIu+pVyrQdpf3+jG4rH6j4Rffl+sN17Zz4dIDDioFL1JwqyCqyCyswR8uACC0Rr8gr4Mi3+HIRbv+2s2P4cIQq41JM8FJe84k9jLEMGCGh69w+ibCWoWs74CokYVA="
|
||||
- OPTIONS="debug_symbols=no verbose=yes progress=no"
|
||||
|
||||
cache:
|
||||
directories:
|
||||
|
@ -20,56 +15,9 @@ cache:
|
|||
|
||||
matrix:
|
||||
include:
|
||||
- name: Static checks (clang-format) + Documentation checks
|
||||
stage: check
|
||||
env: STATIC_CHECKS=yes
|
||||
os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- llvm-toolchain-xenial-8
|
||||
packages:
|
||||
- clang-format-8
|
||||
|
||||
- name: Linux editor (debug, GCC 9, with Mono)
|
||||
- name: iOS export template (release, Clang)
|
||||
stage: build
|
||||
env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="module_mono_enabled=yes mono_glue=no warnings=extra werror=yes"
|
||||
os: linux
|
||||
compiler: gcc-9
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- mono
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- &gcc9_deps [gcc-9, g++-9]
|
||||
- &linux_deps [libasound2-dev, libgl1-mesa-dev, libglu1-mesa-dev, libx11-dev, libxcursor-dev, libxi-dev, libxinerama-dev, libxrandr-dev]
|
||||
- &linux_mono_deps [mono-devel, msbuild, nuget]
|
||||
|
||||
- name: Linux export template (release, Clang)
|
||||
stage: build
|
||||
env: PLATFORM=x11 TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes"
|
||||
os: linux
|
||||
compiler: clang
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- *linux_deps
|
||||
|
||||
- name: Android export template (release_debug, Clang)
|
||||
stage: build
|
||||
env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes"
|
||||
os: linux
|
||||
compiler: clang
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- openjdk-8-jdk
|
||||
|
||||
- name: macOS editor (debug, Clang)
|
||||
stage: build
|
||||
env: PLATFORM=osx TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-clang EXTRA_ARGS="warnings=extra werror=yes"
|
||||
env: PLATFORM=iphone TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang
|
||||
os: osx
|
||||
compiler: clang
|
||||
addons:
|
||||
|
@ -78,76 +26,9 @@ matrix:
|
|||
- scons
|
||||
update: true
|
||||
|
||||
- name: iOS export template (debug, Clang)
|
||||
stage: build
|
||||
env: PLATFORM=iphone TOOLS=no TARGET=debug CACHE_NAME=${PLATFORM}-clang
|
||||
os: osx
|
||||
compiler: clang
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- scons
|
||||
update: true
|
||||
|
||||
- name: Linux headless editor (release_debug, GCC 9, testing project exporting and script running)
|
||||
stage: build
|
||||
env: PLATFORM=server TOOLS=yes TARGET=release_debug CACHE_NAME=${PLATFORM}-tools-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="warnings=extra werror=yes" TEST_PROJECT=yes
|
||||
os: linux
|
||||
compiler: gcc-9
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- *gcc9_deps
|
||||
- *linux_deps
|
||||
|
||||
- name: Linux export template (release_debug, GCC 5, without 3D support)
|
||||
stage: build
|
||||
env: PLATFORM=x11 TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-gcc-5 EXTRA_ARGS="CXXFLAGS=-fno-strict-aliasing disable_3d=yes"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- *linux_deps
|
||||
|
||||
before_install:
|
||||
- eval "${MATRIX_EVAL}"
|
||||
|
||||
install:
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
pyenv global 3.7.1 system;
|
||||
pip3 install --user scons;
|
||||
fi
|
||||
- scons --version
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$PLATFORM" = "android" ]; then
|
||||
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64;
|
||||
export PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:${PATH};
|
||||
java -version;
|
||||
misc/travis/android-tools-linux.sh;
|
||||
fi
|
||||
- if [ "$STATIC_CHECKS" = "yes" ]; then
|
||||
unset SCONS_CACHE;
|
||||
pip3 install --user black pygments;
|
||||
fi
|
||||
|
||||
before_script:
|
||||
- if [ "$PLATFORM" = "android" ]; then
|
||||
export ANDROID_HOME=$TRAVIS_BUILD_DIR/godot-dev/build-tools/android-sdk;
|
||||
export ANDROID_NDK_ROOT=$TRAVIS_BUILD_DIR/godot-dev/build-tools/android-ndk;
|
||||
fi
|
||||
|
||||
script:
|
||||
- if [ "$STATIC_CHECKS" = "yes" ]; then
|
||||
sh ./misc/travis/clang-format.sh &&
|
||||
sh ./misc/travis/black-format.sh &&
|
||||
doc/tools/makerst.py --dry-run doc/classes modules;
|
||||
else
|
||||
scons -j2 CC=$CC CXX=$CXX platform=$PLATFORM tools=$TOOLS target=$TARGET $OPTIONS $EXTRA_ARGS &&
|
||||
if [ "$TEST_PROJECT" = "yes" ]; then
|
||||
git clone --depth 1 "https://github.com/godotengine/godot-tests.git";
|
||||
sed -i "s:custom_template/release=\"\":custom_template/release=\"$(readlink -e bin/godot_server.x11.opt.tools.64)\":" godot-tests/tests/project_export/export_presets.cfg;
|
||||
godot-tests/tests/project_export/test_project.sh "bin/godot_server.x11.opt.tools.64";
|
||||
fi
|
||||
fi
|
||||
- scons -j2 CC=$CC CXX=$CXX platform=$PLATFORM tools=$TOOLS target=$TARGET $OPTIONS $EXTRA_ARGS
|
||||
|
|
|
@ -24,12 +24,12 @@ ANDROID_SDK_URL=$ANDROID_BASE_URL/$ANDROID_SDK_FILENAME
|
|||
ANDROID_SDK_PATH=$GODOT_BUILD_TOOLS_PATH/$ANDROID_SDK_DIR
|
||||
ANDROID_SDK_SHA256=92ffee5a1d98d856634e8b71132e8a95d96c83a63fde1099be3d86df3106def9
|
||||
|
||||
ANDROID_NDK_RELEASE=r20
|
||||
ANDROID_NDK_RELEASE=r21
|
||||
ANDROID_NDK_DIR=android-ndk
|
||||
ANDROID_NDK_FILENAME=android-ndk-$ANDROID_NDK_RELEASE-linux-x86_64.zip
|
||||
ANDROID_NDK_URL=$ANDROID_BASE_URL/$ANDROID_NDK_FILENAME
|
||||
ANDROID_NDK_PATH=$GODOT_BUILD_TOOLS_PATH/$ANDROID_NDK_DIR
|
||||
ANDROID_NDK_SHA1=8665fc84a1b1f0d6ab3b5fdd1e30200cc7b9adff
|
||||
ANDROID_NDK_SHA1=afc9c0b9faad222898ac8168c78ad4ccac8a1b5c
|
||||
|
||||
echo
|
||||
echo "Download and install Android development tools ..."
|
4
misc/ci/sources.list
Normal file
4
misc/ci/sources.list
Normal file
|
@ -0,0 +1,4 @@
|
|||
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
|
||||
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
|
||||
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
|
||||
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
|
35
misc/scripts/black_format.sh
Executable file
35
misc/scripts/black_format.sh
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This script runs black on all Python files in the repo.
|
||||
|
||||
set -uo pipefail
|
||||
|
||||
# Apply black.
|
||||
echo -e "Formatting Python files..."
|
||||
PY_FILES=$(find \( -path "./.git" \
|
||||
-o -path "./thirdparty" \
|
||||
\) -prune \
|
||||
-o \( -name "SConstruct" \
|
||||
-o -name "SCsub" \
|
||||
-o -name "*.py" \
|
||||
\) -print)
|
||||
black -l 120 $PY_FILES
|
||||
|
||||
git diff > patch.patch
|
||||
FILESIZE="$(stat -c%s patch.patch)"
|
||||
MAXSIZE=5
|
||||
|
||||
# If no patch has been generated all is OK, clean up, and exit.
|
||||
if (( FILESIZE < MAXSIZE )); then
|
||||
printf "Files in this commit comply with the black style rules.\n"
|
||||
rm -f patch.patch
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# A patch has been created, notify the user, clean up, and exit.
|
||||
printf "\n*** The following differences were found between the code "
|
||||
printf "and the formatting rules:\n\n"
|
||||
cat patch.patch
|
||||
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
||||
rm -f patch.patch
|
||||
exit 1
|
58
misc/scripts/clang_format.sh
Executable file
58
misc/scripts/clang_format.sh
Executable file
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This script runs clang-format and fixes copyright headers on all relevant files in the repo.
|
||||
# This is the primary script responsible for fixing style violations.
|
||||
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
CLANG_FORMAT_FILE_EXTS=(".c" ".h" ".cpp" ".hpp" ".cc" ".hh" ".cxx" ".m" ".mm" ".inc" ".java" ".glsl")
|
||||
|
||||
# Loops through all text files tracked by Git.
|
||||
git grep -zIl '' |
|
||||
while IFS= read -rd '' f; do
|
||||
# Exclude some files.
|
||||
if [[ "$f" == "thirdparty"* ]]; then
|
||||
continue
|
||||
elif [[ "$f" == "platform/android/java/lib/src/com/google"* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
for extension in ${CLANG_FORMAT_FILE_EXTS[@]}; do
|
||||
if [[ "$f" == *"$extension" ]]; then
|
||||
# Run clang-format.
|
||||
clang-format -i "$f"
|
||||
# Fix copyright headers, but not all files get them.
|
||||
if [[ "$f" == *"inc" ]]; then
|
||||
continue 2
|
||||
elif [[ "$f" == *"glsl" ]]; then
|
||||
continue 2
|
||||
elif [[ "$f" == *"theme_data.h" ]]; then
|
||||
continue 2
|
||||
elif [[ "$f" == "platform/android/java/lib/src/org/godotengine/godot/input/InputManager"* ]]; then
|
||||
continue 2
|
||||
fi
|
||||
python misc/scripts/copyright_headers.py "$f"
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
git diff > patch.patch
|
||||
FILESIZE="$(stat -c%s patch.patch)"
|
||||
MAXSIZE=5
|
||||
|
||||
# If no patch has been generated all is OK, clean up, and exit.
|
||||
if (( FILESIZE < MAXSIZE )); then
|
||||
printf "Files in this commit comply with the clang-format style rules.\n"
|
||||
rm -f patch.patch
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# A patch has been created, notify the user, clean up, and exit.
|
||||
printf "\n*** The following differences were found between the code "
|
||||
printf "and the formatting rules:\n\n"
|
||||
cat patch.patch
|
||||
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
||||
rm -f patch.patch
|
||||
exit 1
|
|
@ -1,6 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
|
||||
header = """\
|
||||
/*************************************************************************/
|
||||
/* $filename */
|
||||
|
@ -33,70 +35,61 @@ header = """\
|
|||
/*************************************************************************/
|
||||
"""
|
||||
|
||||
files = open("files", "r")
|
||||
fname = sys.argv[1]
|
||||
|
||||
fname = files.readline()
|
||||
# Handle replacing $filename with actual filename and keep alignment
|
||||
fsingle = fname.strip()
|
||||
if fsingle.find("/") != -1:
|
||||
fsingle = fsingle[fsingle.rfind("/") + 1 :]
|
||||
rep_fl = "$filename"
|
||||
rep_fi = fsingle
|
||||
len_fl = len(rep_fl)
|
||||
len_fi = len(rep_fi)
|
||||
# Pad with spaces to keep alignment
|
||||
if len_fi < len_fl:
|
||||
for x in range(len_fl - len_fi):
|
||||
rep_fi += " "
|
||||
elif len_fl < len_fi:
|
||||
for x in range(len_fi - len_fl):
|
||||
rep_fl += " "
|
||||
if header.find(rep_fl) != -1:
|
||||
text = header.replace(rep_fl, rep_fi)
|
||||
else:
|
||||
text = header.replace("$filename", fsingle)
|
||||
text += "\n"
|
||||
|
||||
while fname != "":
|
||||
# We now have the proper header, so we want to ignore the one in the original file
|
||||
# and potentially empty lines and badly formatted lines, while keeping comments that
|
||||
# come after the header, and then keep everything non-header unchanged.
|
||||
# To do so, we skip empty lines that may be at the top in a first pass.
|
||||
# In a second pass, we skip all consecutive comment lines starting with "/*",
|
||||
# then we can append the rest (step 2).
|
||||
|
||||
# Handle replacing $filename with actual filename and keep alignment
|
||||
fsingle = fname.strip()
|
||||
if fsingle.find("/") != -1:
|
||||
fsingle = fsingle[fsingle.rfind("/") + 1 :]
|
||||
rep_fl = "$filename"
|
||||
rep_fi = fsingle
|
||||
len_fl = len(rep_fl)
|
||||
len_fi = len(rep_fi)
|
||||
# Pad with spaces to keep alignment
|
||||
if len_fi < len_fl:
|
||||
for x in range(len_fl - len_fi):
|
||||
rep_fi += " "
|
||||
elif len_fl < len_fi:
|
||||
for x in range(len_fi - len_fl):
|
||||
rep_fl += " "
|
||||
if header.find(rep_fl) != -1:
|
||||
text = header.replace(rep_fl, rep_fi)
|
||||
else:
|
||||
text = header.replace("$filename", fsingle)
|
||||
text += "\n"
|
||||
fileread = open(fname.strip(), "r")
|
||||
line = fileread.readline()
|
||||
header_done = False
|
||||
|
||||
# We now have the proper header, so we want to ignore the one in the original file
|
||||
# and potentially empty lines and badly formatted lines, while keeping comments that
|
||||
# come after the header, and then keep everything non-header unchanged.
|
||||
# To do so, we skip empty lines that may be at the top in a first pass.
|
||||
# In a second pass, we skip all consecutive comment lines starting with "/*",
|
||||
# then we can append the rest (step 2).
|
||||
|
||||
fileread = open(fname.strip(), "r")
|
||||
while line.strip() == "": # Skip empty lines at the top
|
||||
line = fileread.readline()
|
||||
header_done = False
|
||||
|
||||
while line.strip() == "": # Skip empty lines at the top
|
||||
line = fileread.readline()
|
||||
if line.find("/**********") == -1: # Godot header starts this way
|
||||
# Maybe starting with a non-Godot comment, abort header magic
|
||||
header_done = True
|
||||
|
||||
if line.find("/**********") == -1: # Godot header starts this way
|
||||
# Maybe starting with a non-Godot comment, abort header magic
|
||||
while not header_done: # Handle header now
|
||||
if line.find("/*") != 0: # No more starting with a comment
|
||||
header_done = True
|
||||
if line.strip() != "":
|
||||
text += line
|
||||
line = fileread.readline()
|
||||
|
||||
while not header_done: # Handle header now
|
||||
if line.find("/*") != 0: # No more starting with a comment
|
||||
header_done = True
|
||||
if line.strip() != "":
|
||||
text += line
|
||||
line = fileread.readline()
|
||||
while line != "": # Dump everything until EOF
|
||||
text += line
|
||||
line = fileread.readline()
|
||||
|
||||
while line != "": # Dump everything until EOF
|
||||
text += line
|
||||
line = fileread.readline()
|
||||
fileread.close()
|
||||
|
||||
fileread.close()
|
||||
|
||||
# Write
|
||||
filewrite = open(fname.strip(), "w")
|
||||
filewrite.write(text)
|
||||
filewrite.close()
|
||||
|
||||
# Next file
|
||||
fname = files.readline()
|
||||
|
||||
files.close()
|
||||
# Write
|
||||
filewrite = open(fname.strip(), "w")
|
||||
filewrite.write(text)
|
||||
filewrite.close()
|
59
misc/scripts/file_format.sh
Executable file
59
misc/scripts/file_format.sh
Executable file
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This script ensures proper POSIX text file formatting and a few other things.
|
||||
# This is supplementary to clang-black-format.sh, but should be run before it.
|
||||
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Loops through all text files tracked by Git.
|
||||
git grep -zIl '' |
|
||||
while IFS= read -rd '' f; do
|
||||
# Exclude some types of files.
|
||||
if [[ "$f" == *"csproj" ]]; then
|
||||
continue
|
||||
elif [[ "$f" == *"sln" ]]; then
|
||||
continue
|
||||
elif [[ "$f" == *"patch" ]]; then
|
||||
continue
|
||||
elif [[ "$f" == *"pot" ]]; then
|
||||
continue
|
||||
elif [[ "$f" == *"po" ]]; then
|
||||
continue
|
||||
elif [[ "$f" == "thirdparty"* ]]; then
|
||||
continue
|
||||
elif [[ "$f" == "platform/android/java/lib/src/com/google"* ]]; then
|
||||
continue
|
||||
fi
|
||||
# Ensures that files are UTF-8 formatted.
|
||||
recode UTF-8 "$f" 2> /dev/null
|
||||
# Ensures that files have LF line endings.
|
||||
dos2unix "$f" 2> /dev/null
|
||||
# Ensures that files do not contain a BOM.
|
||||
sed -i '1s/^\xEF\xBB\xBF//' "$f"
|
||||
# Ensures that files end with newline characters.
|
||||
tail -c1 < "$f" | read -r _ || echo >> "$f";
|
||||
# Remove trailing space characters.
|
||||
sed -z -i 's/\x20\x0A/\x0A/g' "$f"
|
||||
# Remove the character sequence "== true" if it has a leading space.
|
||||
sed -z -i 's/\x20== true//g' "$f"
|
||||
done
|
||||
|
||||
git diff > patch.patch
|
||||
FILESIZE="$(stat -c%s patch.patch)"
|
||||
MAXSIZE=5
|
||||
|
||||
# If no patch has been generated all is OK, clean up, and exit.
|
||||
if (( FILESIZE < MAXSIZE )); then
|
||||
printf "Files in this commit comply with the formatting rules.\n"
|
||||
rm -f patch.patch
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# A patch has been created, notify the user, clean up, and exit.
|
||||
printf "\n*** The following differences were found between the code "
|
||||
printf "and the formatting rules:\n\n"
|
||||
cat patch.patch
|
||||
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
||||
rm -f patch.patch
|
||||
exit 1
|
|
@ -1,60 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Command line arguments
|
||||
run_clang_format=false
|
||||
run_fix_headers=false
|
||||
usage="Invalid argument. Usage:\n$0 <option>\n\t--clang-format|-c\n\t--headers|-h\n\t--all|-a"
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo -e $usage
|
||||
exit 0
|
||||
fi
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--clang-format|-c)
|
||||
run_clang_format=true
|
||||
;;
|
||||
--headers|-h)
|
||||
run_fix_headers=true
|
||||
;;
|
||||
--all|-a)
|
||||
run_clang_format=true
|
||||
run_fix_headers=true
|
||||
;;
|
||||
*)
|
||||
echo -e $usage
|
||||
exit 0
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
echo "Removing generated files, some have binary data and make clang-format freeze."
|
||||
find -name "*.gen.*" -delete
|
||||
|
||||
# Apply clang-format
|
||||
if $run_clang_format; then
|
||||
# Sync list with pre-commit hook
|
||||
FILE_EXTS=".c .h .cpp .hpp .cc .hh .cxx .m .mm .inc .java .glsl"
|
||||
|
||||
for extension in ${FILE_EXTS}; do
|
||||
echo -e "Formatting ${extension} files..."
|
||||
find \( -path "./.git" \
|
||||
-o -path "./thirdparty" \
|
||||
-o -path "./platform/android/java/lib/src/com/google" \
|
||||
\) -prune \
|
||||
-o -name "*${extension}" \
|
||||
-exec clang-format -i {} \;
|
||||
done
|
||||
fi
|
||||
|
||||
# Add missing copyright headers
|
||||
if $run_fix_headers; then
|
||||
echo "Fixing copyright headers in Godot code files..."
|
||||
find \( -path "./.git" -o -path "./thirdparty" \) -prune \
|
||||
-o -regex '.*\.\(c\|h\|cpp\|hpp\|cc\|hh\|cxx\|m\|mm\|java\)' \
|
||||
> tmp-files
|
||||
cat tmp-files | grep -v ".git\|thirdparty\|theme_data.h\|platform/android/java/lib/src/com/google\|platform/android/java/lib/src/org/godotengine/godot/input/InputManager" > files
|
||||
python misc/scripts/fix_headers.py
|
||||
rm -f tmp-files files
|
||||
fi
|
|
@ -1,48 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
BLACK=black
|
||||
BLACK_OPTIONS="-l 120"
|
||||
|
||||
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
||||
# Travis only clones the PR branch and uses its HEAD commit as detached HEAD,
|
||||
# so it's problematic when we want an exact commit range for format checks.
|
||||
# We fetch upstream to ensure that we have the proper references to resolve.
|
||||
# Ideally we would use $TRAVIS_COMMIT_RANGE but it doesn't play well with PR
|
||||
# updates, as it only includes changes since the previous state of the PR.
|
||||
if [ -z "$(git remote | grep upstream)" ]; then
|
||||
git remote add upstream https://github.com/godotengine/godot \
|
||||
--no-tags -f -t $TRAVIS_BRANCH
|
||||
fi
|
||||
RANGE="upstream/$TRAVIS_BRANCH HEAD"
|
||||
else
|
||||
# Test only the last commit, since $TRAVIS_COMMIT_RANGE wouldn't support
|
||||
# force pushes.
|
||||
RANGE=HEAD
|
||||
fi
|
||||
|
||||
FILES=$(git diff-tree --no-commit-id --name-only -r $RANGE | grep -v thirdparty/| grep -E "(SConstruct|SCsub|\.py)$")
|
||||
echo "Checking files:\n$FILES"
|
||||
|
||||
# create a random filename to store our generated patch
|
||||
prefix="static-check-black"
|
||||
suffix="$(date +%s)"
|
||||
patch="/tmp/$prefix-$suffix.patch"
|
||||
|
||||
for file in $FILES; do
|
||||
"$BLACK" "$BLACK_OPTIONS" --diff "$file" | \
|
||||
sed -e "1s|--- |--- a/|" -e "2s|+++ |+++ b/|" >> "$patch"
|
||||
done
|
||||
|
||||
# if no patch has been generated all is ok, clean up the file stub and exit
|
||||
if [ ! -s "$patch" ] ; then
|
||||
printf "Files in this commit comply with the black formatting rules.\n"
|
||||
rm -f "$patch"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# a patch has been created, notify the user and exit
|
||||
printf "\n*** The following differences were found between the code to commit "
|
||||
printf "and the black formatting rules:\n\n"
|
||||
pygmentize -l diff "$patch"
|
||||
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
||||
exit 1
|
|
@ -1,43 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo
|
||||
echo "Download and install ccache ..."
|
||||
echo
|
||||
|
||||
echo "Downloading sources ..."
|
||||
curl -L -O https://www.samba.org/ftp/ccache/ccache-3.3.4.tar.gz # latest version available here: https://ccache.samba.org/download.html
|
||||
|
||||
echo "Extracting to build directory ..."
|
||||
tar xzf ccache-3.3.4.tar.gz
|
||||
cd ccache-3.3.4
|
||||
|
||||
echo "Compiling sources ..."
|
||||
./configure --prefix=/usr/local --with-bundled-zlib > /dev/null
|
||||
make
|
||||
|
||||
echo "Installing ..."
|
||||
|
||||
mkdir /usr/local/opt/ccache
|
||||
|
||||
mkdir /usr/local/opt/ccache/bin
|
||||
cp ccache /usr/local/opt/ccache/bin
|
||||
ln -s /usr/local/opt/ccache/bin/ccache /usr/local/bin/ccache
|
||||
|
||||
mkdir /usr/local/opt/ccache/libexec
|
||||
links=(
|
||||
clang
|
||||
clang++
|
||||
cc
|
||||
gcc gcc2 gcc3 gcc-3.3 gcc-4.0 gcc-4.2 gcc-4.3 gcc-4.4 gcc-4.5 gcc-4.6 gcc-4.7 gcc-4.8 gcc-4.9 gcc-5 gcc-6 gcc-7
|
||||
c++ c++3 c++-3.3 c++-4.0 c++-4.2 c++-4.3 c++-4.4 c++-4.5 c++-4.6 c++-4.7 c++-4.8 c++-4.9 c++-5 c++-6 c++-7
|
||||
g++ g++2 g++3 g++-3.3 g++-4.0 g++-4.2 g++-4.3 g++-4.4 g++-4.5 g++-4.6 g++-4.7 g++-4.8 g++-4.9 g++-5 g++-6 g++-7
|
||||
)
|
||||
for link in "${links[@]}"; do
|
||||
ln -s ../bin/ccache /usr/local/opt/ccache/libexec/$link
|
||||
done
|
||||
#/usr/local/bin/ccache -M 2G
|
||||
cd $TRAVIS_BUILD_DIR
|
||||
|
||||
echo
|
||||
echo "Done!"
|
||||
echo
|
|
@ -1,48 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
CLANG_FORMAT=clang-format-8
|
||||
|
||||
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
||||
# Travis only clones the PR branch and uses its HEAD commit as detached HEAD,
|
||||
# so it's problematic when we want an exact commit range for format checks.
|
||||
# We fetch upstream to ensure that we have the proper references to resolve.
|
||||
# Ideally we would use $TRAVIS_COMMIT_RANGE but it doesn't play well with PR
|
||||
# updates, as it only includes changes since the previous state of the PR.
|
||||
if [ -z "$(git remote | grep upstream)" ]; then
|
||||
git remote add upstream https://github.com/godotengine/godot \
|
||||
--no-tags -f -t $TRAVIS_BRANCH
|
||||
fi
|
||||
RANGE="upstream/$TRAVIS_BRANCH HEAD"
|
||||
else
|
||||
# Test only the last commit, since $TRAVIS_COMMIT_RANGE wouldn't support
|
||||
# force pushes.
|
||||
RANGE=HEAD
|
||||
fi
|
||||
|
||||
FILES=$(git diff-tree --no-commit-id --name-only -r $RANGE | grep -v thirdparty/ | grep -v platform/android/java/lib/src/com/ | grep -E "\.(c|h|cpp|hpp|cc|hh|cxx|m|mm|inc|java|glsl)$")
|
||||
echo "Checking files:\n$FILES"
|
||||
|
||||
# create a random filename to store our generated patch
|
||||
prefix="static-check-clang-format"
|
||||
suffix="$(date +%s)"
|
||||
patch="/tmp/$prefix-$suffix.patch"
|
||||
|
||||
for file in $FILES; do
|
||||
"$CLANG_FORMAT" -style=file "$file" | \
|
||||
diff -u "$file" - | \
|
||||
sed -e "1s|--- |--- a/|" -e "2s|+++ -|+++ b/$file|" >> "$patch"
|
||||
done
|
||||
|
||||
# if no patch has been generated all is ok, clean up the file stub and exit
|
||||
if [ ! -s "$patch" ] ; then
|
||||
printf "Files in this commit comply with the clang-format rules.\n"
|
||||
rm -f "$patch"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# a patch has been created, notify the user and exit
|
||||
printf "\n*** The following differences were found between the code to commit "
|
||||
printf "and the clang-format rules:\n\n"
|
||||
pygmentize -l diff "$patch"
|
||||
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
||||
exit 1
|
Loading…
Reference in a new issue