mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 19:15:11 +01:00
Reduce Lists Memory usage, update CI (#17706)
* Convert alerts to a lazylist * Convert fullscreens to lazylist * Convert ckeys_allowed_itemspawn to a lazylist * Convert camera lists to lazylists * Get rid of an old unused footstep_sounds list * Make flooring_cache a lazy list * Fix flooring_blacklist, convert a bunch more flooring lists to lazylists * Improve ci byond caching
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
# This action attempts to restore BYOND from a cache, or to install it otherwise.
|
||||
name: Restore or Install BYOND
|
||||
description: Attempts to restore a specified BYOND version from cache; if it can't, it installs it.
|
||||
|
||||
inputs:
|
||||
major:
|
||||
description: "The major BYOND version to install. Defaults to the BYOND_MAJOR specified in `dependencies.sh`."
|
||||
required: false
|
||||
type: string
|
||||
minor:
|
||||
description: "The minor BYOND version to install. Defaults to the BYOND_MINOR specified in `dependencies.sh`."
|
||||
required: false
|
||||
type: string
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Configure BYOND version from inputs
|
||||
if: ${{ inputs.major }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "BYOND_MAJOR=${{ inputs.major }}" >> $GITHUB_ENV
|
||||
echo "BYOND_MINOR=${{ inputs.minor }}" >> $GITHUB_ENV
|
||||
- name: Configure BYOND version from dependencies.sh
|
||||
if: ${{ !inputs.major }}
|
||||
shell: bash
|
||||
run: |
|
||||
source dependencies.sh
|
||||
echo "BYOND_MAJOR=$BYOND_MAJOR" >> $GITHUB_ENV
|
||||
echo "BYOND_MINOR=$BYOND_MINOR" >> $GITHUB_ENV
|
||||
|
||||
# The use of `actions/cache/restore` and `actions/cache/save` here is deliberate, as we want to
|
||||
# save the BYOND install to a cache as early as possible. If we used just `actions/cache`, it
|
||||
# would only attempt to save the cache at the end of a job. This ensures that if a workflow run
|
||||
# is cancelled, we already have a cache to restore from.
|
||||
- name: Restore BYOND cache
|
||||
id: restore_byond_cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ~/BYOND
|
||||
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }}
|
||||
- name: Install BYOND
|
||||
if: ${{ !steps.restore_byond_cache.outputs.cache-hit }}
|
||||
shell: bash
|
||||
run: bash tools/ci/install_byond.sh
|
||||
- name: Save BYOND cache
|
||||
if: ${{ !steps.restore_byond_cache.outputs.cache-hit }}
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: ~/BYOND
|
||||
key: ${{ steps.restore_byond_cache.outputs.cache-primary-key }}
|
||||
@@ -0,0 +1,26 @@
|
||||
# This action is a wrapper around `actions/setup-node`, to use the version specified in
|
||||
# `dependencies.sh`.
|
||||
name: Setup Node
|
||||
description: Install Node using the version specified in `dependencies.sh`; additionally, restores the Yarn cache if one exists
|
||||
|
||||
inputs:
|
||||
restore-yarn-cache:
|
||||
description: 'If `true`, restores the Yarn cache alongside installing node.'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Configure Node version
|
||||
shell: bash
|
||||
run: |
|
||||
source dependencies.sh
|
||||
echo "NODE_VERSION_REQUIRED=$NODE_VERSION_LTS" >> $GITHUB_ENV
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION_REQUIRED }}
|
||||
cache: ${{ fromJSON(inputs.restore-yarn-cache) && 'yarn' || '' }}
|
||||
cache-dependency-path: ${{ fromJSON(inputs.restore-yarn-cache) && 'tgui/yarn.lock' || '' }}
|
||||
@@ -20,20 +20,10 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# Caches
|
||||
- name: Restore Yarn cache
|
||||
uses: actions/cache@v4
|
||||
- name: Setup Node
|
||||
uses: ./.github/actions/setup_node
|
||||
with:
|
||||
path: tgui/.yarn/cache
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- name: Restore Node cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.nvm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('dependencies.sh') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
restore-yarn-cache: true
|
||||
- name: Restore Bootstrap cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
@@ -57,7 +47,6 @@ jobs:
|
||||
- name: Install Tools
|
||||
run: |
|
||||
pip3 install setuptools
|
||||
bash tools/ci/install_node.sh
|
||||
bash tools/ci/install_ripgrep.sh
|
||||
bash tools/ci/install_spaceman_dmm.sh dmm-tools
|
||||
tools/bootstrap/python -c ''
|
||||
@@ -136,11 +125,11 @@ jobs:
|
||||
- name: Ensure +x on CI directory
|
||||
run: |
|
||||
chmod -R +x ./tools/ci
|
||||
- name: Restore BYOND Cache
|
||||
uses: actions/cache@v4
|
||||
- name: Restore BYOND from Cache
|
||||
uses: ./.github/actions/restore_or_install_byond
|
||||
with:
|
||||
path: $HOME/byond
|
||||
key: ${{ runner.os }}-byond
|
||||
major: ${{ inputs.major }}
|
||||
minor: ${{ inputs.minor }}
|
||||
- name: Install RUST_G Dependencies
|
||||
run: |
|
||||
sudo dpkg --add-architecture i386
|
||||
@@ -150,9 +139,7 @@ jobs:
|
||||
ldd libbapi_dmm_reader.so
|
||||
ldd libverdigris.so
|
||||
- name: Unit Tests
|
||||
run: |
|
||||
tools/ci/install_byond.sh
|
||||
tools/ci/compile_and_run.sh
|
||||
run: tools/ci/compile_and_run.sh
|
||||
env:
|
||||
EXTRA_ARGS: "-DUNIT_TEST -D${{ matrix.map }}"
|
||||
RUN: "1"
|
||||
|
||||
Reference in New Issue
Block a user