util/stringops: constify hexdigest() #1010
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Builds | |
on: | |
push: | |
branches: | |
- master | |
- staging | |
- staging/* | |
- v[0-9].[0-9]** | |
paths: | |
- "**.c" | |
- "**.h" | |
- "**.m" | |
- "**.yml" | |
- "**.yaml" | |
- "**.build" | |
- "**.ini" | |
- "**.wrap" | |
pull_request: | |
paths: | |
- "**.c" | |
- "**.h" | |
- "**.m" | |
- "**.yml" | |
- "**.yaml" | |
- "**.build" | |
- "**.ini" | |
- "**.wrap" | |
env: | |
MESON_VERSION: '0.63.3' | |
EM_VERSION: '3.1.51' | |
EM_CACHE_FOLDER: 'emsdk' | |
TAISEI_NOPRELOAD: 0 | |
TAISEI_PRELOAD_REQUIRED: 1 | |
jobs: | |
linux-test-build: | |
name: Linux (x64) | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install Tools | |
run: > | |
sudo apt update || true # debian cache is not atomic and can sometimes fail | |
sudo apt install -y -qq | |
build-essential | |
libsdl2-dev | |
libogg-dev | |
libopusfile-dev | |
libpng-dev | |
libzip-dev | |
libx11-dev | |
libwayland-dev | |
python3-docutils | |
libwebp-dev | |
libfreetype6-dev | |
libzstd-dev | |
libssl-dev | |
pip install | |
meson==${{ env.MESON_VERSION }} | |
ninja | |
zstandard | |
- name: Configure | |
run: > | |
meson setup build/ | |
--native-file misc/ci/common-options.ini | |
--native-file misc/ci/nofallback.ini | |
--native-file misc/ci/linux-x86_64-build-test-ci.ini | |
--prefix=$(pwd)/build-test | |
- name: Build | |
run: | | |
meson compile -C build/ --verbose | |
meson install -C build/ | |
- name: Run Test | |
run: $(pwd)/build-test/bin/taisei -R $(pwd)/misc/ci/tests/test-replay.tsr | |
env: | |
TAISEI_NOPRELOAD: ${{ env.TAISEI_NOPRELOAD }} | |
TAISEI_PRELOAD_REQUIRED: ${{ env.TAISEI_PRELOAD_REQUIRED }} | |
- name: Upload Log | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: taisei_linux_fail_log | |
path: build/meson-logs/meson-log.txt | |
if-no-files-found: warn | |
macos-test-build: | |
name: macOS (x64) | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
runs-on: macos-12 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install Tools | |
run: > | |
brew install | |
gcc | |
pkg-config | |
docutils | |
pygments | |
freetype2 | |
libzip | |
opusfile | |
libvorbis | |
webp | |
sdl2 | |
ninja | |
pip install | |
meson==${{ env.MESON_VERSION }} | |
ninja | |
setuptools | |
zstandard | |
- name: Configure | |
run: > | |
meson setup build/ | |
--native-file misc/ci/common-options.ini | |
--native-file misc/ci/nofallback.ini | |
--native-file misc/ci/macos-x86_64-build-test-ci.ini | |
--prefix=$(pwd)/build-test | |
- name: Build | |
run: | | |
meson compile -C build/ --verbose | |
meson install -C build/ | |
- name: Run Test | |
run: $(pwd)/build-test/Taisei.app/Contents/MacOS/Taisei -R $(pwd)/misc/ci/tests/test-replay.tsr | |
env: | |
TAISEI_NOPRELOAD: ${{ env.TAISEI_NOPRELOAD }} | |
TAISEI_PRELOAD_REQUIRED: ${{ env.TAISEI_PRELOAD_REQUIRED }} | |
- name: Upload Log | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: taisei_macos_fail_log | |
path: build/meson-logs/meson-log.txt | |
if-no-files-found: warn | |
windows-test-build: | |
name: Windows (x64) | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
runs-on: ubuntu-latest | |
container: taiseiproject/windows-toolkit:20240304 # cross-compiler with mingw | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Configure Taisei (Meson) | |
run: > | |
meson setup build/ | |
--cross-file misc/ci/common-options.ini | |
--cross-file misc/ci/forcefallback.ini | |
--cross-file misc/ci/windows-llvm_mingw-x86_64-build-test-ci.ini | |
--prefix=$(pwd)/build-test | |
- name: Build | |
run: | | |
meson compile -C build/ --verbose | |
meson install -C build/ | |
- name: Upload Log | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: taisei_windows_fail_log | |
path: build/meson-logs/meson-log.txt | |
if-no-files-found: warn | |
emscripten-test-build: | |
name: "Emscripten" | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
fetch-depth: 0 | |
- name: Fetch Git Tags | |
run: | | |
git config --add safe.directory $(pwd) | |
git fetch --force --tags | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install Tools | |
run: > | |
sudo apt update || true | |
sudo apt install -y -qq | |
python3-docutils | |
python3-pip | |
git | |
pip install | |
meson==${{ env.MESON_VERSION }} | |
ninja | |
zstandard | |
python-gnupg # required as we call into gen-dist.py for Emscripten | |
- name: Fetch Cached Emscripten SDK | |
id: emsdk-cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.EM_CACHE_FOLDER }} | |
key: ${{ env.EM_VERSION }}-${{ runner.os }} | |
- name: Install Emscripten SDK | |
if: steps.emsdk-cache.outputs.cache-hit != 'true' | |
run: | | |
rm -rf ./${{ env.EM_CACHE_FOLDER }}/ | |
git clone https://github.com/emscripten-core/emsdk.git ${{ env.EM_CACHE_FOLDER }} | |
${{ env.EM_CACHE_FOLDER }}/emsdk install ${{ env.EM_VERSION }} | |
${{ env.EM_CACHE_FOLDER }}/emsdk activate ${{ env.EM_VERSION }} | |
- name: Verify Emscripten SDK | |
run: | | |
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh | |
emcc -v | |
tee misc/ci/emscripten-ephemeral-ci.ini <<EOF >/dev/null | |
[constants] | |
toolchain = '$(pwd)/${{ env.EM_CACHE_FOLDER }}/upstream/emscripten/' | |
EOF | |
- name: Configure Standard Version | |
run: > | |
scripts/version.py > .VERSION.tmp | |
mv .VERSION.tmp .VERSION | |
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh | |
meson setup build/ | |
--cross-file misc/ci/common-options.ini | |
--cross-file misc/ci/forcefallback.ini | |
--cross-file misc/ci/emscripten-ephemeral-ci.ini | |
--cross-file misc/ci/emscripten-build.ini | |
--prefix=$(pwd)/taisei-web-test | |
-Dbuild.cpp_std=gnu++14 | |
- name: Build Standard Version | |
run: | | |
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh | |
meson compile tar -C build/ --verbose | |
- name: Checkout taisei-web-test | |
uses: actions/checkout@v4 | |
if: github.ref == 'refs/heads/master' | |
with: | |
repository: taisei-project/taisei-web-test | |
ssh-key: ${{ secrets.WEB_SSH_DEPLOY_KEY }} | |
path: taisei-web-test | |
clean: false | |
- name: Prepare taisei-web-test | |
if: github.ref == 'refs/heads/master' | |
run: | | |
rm -v taisei-web-test/data/* | |
- name: Install Standard Version to taisei-web-test | |
if: github.ref == 'refs/heads/master' | |
run: | | |
meson install -C build --no-rebuild | |
- name: Configure Developer Version | |
if: github.ref == 'refs/heads/master' | |
run: | | |
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh | |
sed -i "s/^\(taisei_basename = \).*/\1'taisei-dev'/" src/meson.build # I'm sorry | |
meson setup --reconfigure $(pwd) build/ -Ddeveloper=true | |
- name: Build Developer Version | |
if: github.ref == 'refs/heads/master' | |
run: | | |
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh | |
meson compile -C build/ --verbose | |
- name: Install Developer Version to taisei-web-test | |
if: github.ref == 'refs/heads/master' | |
run: | | |
meson install -C build --no-rebuild | |
- name: Deploy to taisei-web-test | |
if: github.ref == 'refs/heads/master' | |
run: | | |
TAISEI_VERSION=$(scripts/version.py) | |
cd taisei-web-test | |
git config user.name 'Nitori Kawashiro [bot]' | |
git config user.email '[email protected]' | |
git add . | |
git commit -m "Taisei $TAISEI_VERSION" | |
git push | |
- name: Upload Log | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: taisei_emscripten_stable_build_log | |
path: build/meson-logs/meson-log.txt | |
if-no-files-found: warn | |
switch-test-build: | |
name: Switch (ARM64) | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
runs-on: ubuntu-latest | |
container: taiseiproject/switch-toolkit:20240305 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Configure | |
run: > | |
switch/crossfile.sh > misc/ci/switch-crossfile-ci.ini | |
meson setup build/ | |
--cross-file misc/ci/common-options.ini | |
--cross-file misc/ci/switch-options.ini | |
--cross-file misc/ci/switch-crossfile-ci.ini | |
--prefix=$(pwd)/build-test | |
- name: Build | |
run: meson compile -C build/ --verbose | |
- name: Upload Log | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: taisei_switch_build_log | |
path: build/meson-logs/meson-log.txt | |
if-no-files-found: warn |