Add cache
Some checks failed
Build / download-system-deps (push) Successful in 26s
Build / get-source-code (push) Failing after 5s
Build / build-android (push) Has been skipped
Build / build-windows (push) Has been skipped
Build / build-appimage (push) Has been skipped
Build / build-gentoo (push) Successful in 1m2s

This commit is contained in:
Zachary Hall 2024-10-20 16:41:45 -07:00
parent ab7ee688d4
commit 56b4b0f3c3

View file

@ -3,9 +3,27 @@ run-name: Build the project
on: [push] on: [push]
jobs: jobs:
download-system-deps:
runs-on: ubuntu-latest
steps:
- name: Cache system dependencies
id: cache-system-deps
uses: actions/cache@v4
with:
key: system-deps-${{ runner.os }}-apt-{{ hashFiles('.forgejo/**') }}
path: /var/cache/apt
restore-keys: |
system-deps-${{ runner.os }}-apt
- name: Download system dependencies
run: apt-get update && apt-get install -y zstd cmake build-essential python3 python3-pip python3-venv wget gcc-mingw-w64 g++-mingw-w64
get-source-code: get-source-code:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Load system dependency cache
uses: actions/cache/restore@v4
with:
key: ${{jobs.download-system-deps.step.cache-system-deps.key }}
path: /var/cache/apt
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
@ -15,7 +33,7 @@ jobs:
- name: Set up SDL android project - name: Set up SDL android project
run: ./setup.sh && ./setup-android-project.sh run: ./setup.sh && ./setup-android-project.sh
- name: Install ZSTD compressor - name: Install ZSTD compressor
run: apt-get update && apt-get install -y zstd run: apt-get install -y zstd
- name: Create archive - name: Create archive
run: rm source.tar.zst -f; tar --exclude-vcs -c --to-stdout --exclude=source.tar.zst ./* ./.* | zstd -19 -T0 -o source.tar.zst run: rm source.tar.zst -f; tar --exclude-vcs -c --to-stdout --exclude=source.tar.zst ./* ./.* | zstd -19 -T0 -o source.tar.zst
- name: Upload source code - name: Upload source code
@ -31,18 +49,31 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: get-source-code needs: get-source-code
steps: steps:
- name: Load system dependency cache
uses: actions/cache/restore@v4
with:
key: ${{jobs.download-system-deps.step.cache-system-deps.key }}
path: /var/cache/apt
- name: Download repository code - name: Download repository code
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: source_archive name: source_archive
path: . path: .
- name: Install ZSTD compressor - name: Install ZSTD compressor and system dependencies
run: apt-get update && apt-get install -y zstd run: apt-get install -y zstd wget python3 python3-pip python3-venv cmake build-essential
- name: Extract repository code - name: Extract repository code
run: tar -xf source.tar.zst run: tar -xf source.tar.zst
- name: Install system dependencies - name: Cache python dependencies
run: apt update && apt install -y wget python3 python3-pip python3-venv id: cache-python-deps
- name: Install Python dependencies via pip uses: actions/cache@v4
with:
key: python-deps-${{ runner.os }}-python-${{ hashFiles('.forgejo/**') }}
path: venv
restore-keys: |
python-deps-${{ runner.os }}-python
- name: Create virtual environment and install Python dependencies
if: steps.cache-python-deps.cache-hit != 'true'
run: python3 -m venv venv && ./venv/bin/pip install pylddwrap run: python3 -m venv venv && ./venv/bin/pip install pylddwrap
- name: Build project - name: Build project
run: ./build-appimage.sh run: ./build-appimage.sh
@ -62,15 +93,22 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: get-source-code needs: get-source-code
steps: steps:
- name: Load system dependency cache
uses: actions/cache/restore@v4
with:
key: ${{jobs.download-system-deps.step.cache-system-deps.key }}
path: /var/cache/apt
- name: Download repository code - name: Download repository code
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: source_archive name: source_archive
path: . path: .
- name: Install ZSTD compressor - name: Install ZSTD compressor, CMake, and build environment
run: apt-get update && apt-get install -y zstd run: apt-get install -y zstd cmake build-essential
- name: Extract repository code - name: Extract repository code
run: tar -xf source.tar.zst run: tar -xf source.tar.zst
- name: Build protoc
run: ./build-protoc.sh
- name: Setup Java - name: Setup Java
uses: fam-tech/setup-java@v3 uses: fam-tech/setup-java@v3
with: with:
@ -102,19 +140,24 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: get-source-code needs: get-source-code
steps: steps:
- name: Load system dependency cache
uses: actions/cache/restore@v4
with:
key: ${{jobs.download-system-deps.step.cache-system-deps.key }}
path: /var/cache/apt
- name: Download repository code - name: Download repository code
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: source_archive name: source_archive
path: . path: .
- name: Install ZSTD compressor - name: Install ZSTD compressor
run: apt-get update && apt-get install -y zstd run: apt-get install -y zstd
- name: Extract repository code - name: Extract repository code
run: tar -xf source.tar.zst run: tar -xf source.tar.zst
- name: Install MinGW compiler, CMake, and build environment
run: apt-get install -y gcc-mingw-w64 g++-mingw-w64 cmake build-essential
- name: Build protoc - name: Build protoc
run: ./build-protoc.sh run: ./build-protoc.sh
- name: Install MinGW compiler
run: apt-get update && apt-get install gcc-mingw-w64 g++-mingw-w64 -y
- name: Build with CMake - name: Build with CMake
run: mkdir -p build-windows && cd build-windows && cmake .. -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-gcc -G Ninja -DDISABLE_GTK_UI=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_LIBFMT=ON -DUSE_PORTALS=OFF -DENABLE_DBUS=OFF -DBUILD_STATIC=ON -DDOWNLOAD_AUDIO_CODECS_DEPENDENCY=ON -DSDL_MIXER_X_SHARED=OFF -DSDL_MIXER_X_STATIC=ON -DUSE_OGG_VORBIS_STB=ON -DUSE_OPUS=OFF -DUSE_MODPLUG=OFF -DUSE_GME=OFF -DUSE_WAVPACK=OFF -DUSE_XMP=OFF -DUSE_MIDI_EDMIDI=OFF -DUSE_SYSTEM_SDL2=OFF -DBUILD_PROTOC=OFF -DBUILD_SDL=ON -DBUILD_SDL_IMAGE=ON -DBUILD_JSONCPP=ON -DBUILD_SOUNDTOUCH=ON -DBUILD_PROTOBUF=ON -DDISABLE_IMGUI_UI=OFF && ninja && cd .. run: mkdir -p build-windows && cd build-windows && cmake .. -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-gcc -G Ninja -DDISABLE_GTK_UI=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_LIBFMT=ON -DUSE_PORTALS=OFF -DENABLE_DBUS=OFF -DBUILD_STATIC=ON -DDOWNLOAD_AUDIO_CODECS_DEPENDENCY=ON -DSDL_MIXER_X_SHARED=OFF -DSDL_MIXER_X_STATIC=ON -DUSE_OGG_VORBIS_STB=ON -DUSE_OPUS=OFF -DUSE_MODPLUG=OFF -DUSE_GME=OFF -DUSE_WAVPACK=OFF -DUSE_XMP=OFF -DUSE_MIDI_EDMIDI=OFF -DUSE_SYSTEM_SDL2=OFF -DBUILD_PROTOC=OFF -DBUILD_SDL=ON -DBUILD_SDL_IMAGE=ON -DBUILD_JSONCPP=ON -DBUILD_SOUNDTOUCH=ON -DBUILD_PROTOBUF=ON -DDISABLE_IMGUI_UI=OFF && ninja && cd ..
- name: Upload artifact - name: Upload artifact