Skip to content

fix(skyrim-platform): fix crash related to bad event names (#1710) #3825

fix(skyrim-platform): fix crash related to bad event names (#1710)

fix(skyrim-platform): fix crash related to bad event names (#1710) #3825

name: PR Ubuntu Docker
on:
pull_request:
# any
push:
branches:
- main
env:
BUILD_TYPE: RelWithDebInfo
jobs:
pr-ubuntu-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Get image to build upon
run: |
cat ${{github.workspace}}/misc/github_env_linux >> "$GITHUB_ENV"
- name: Store SP types from commit
run: |
commit=$(< ${{github.workspace}}/skyrim-platform/src/platform_se/codegen/convert-files/skyrimPlatform.ts)
chmod 777 ${{github.workspace}}/skyrim-platform/src/platform_se/codegen/convert-files
echo "$commit" > ${{github.workspace}}/skyrim-platform/src/platform_se/codegen/convert-files/temp.txt
# Download Skyrim SE data files
- uses: suisei-cn/actions-download-file@v1
name: Download Skyrim.esm
with:
url: "https://gitlab.com/pospelov/se-data/-/raw/main/Skyrim.esm"
target: ${{github.workspace}}/skyrim_data_files/
- uses: suisei-cn/actions-download-file@v1
name: Download Update.esm
with:
url: "https://gitlab.com/pospelov/se-data/-/raw/main/Update.esm"
target: ${{github.workspace}}/skyrim_data_files/
- uses: suisei-cn/actions-download-file@v1
name: Download Dawnguard.esm
with:
url: "https://gitlab.com/pospelov/se-data/-/raw/main/Dawnguard.esm"
target: ${{github.workspace}}/skyrim_data_files/
- uses: suisei-cn/actions-download-file@v1
name: Download HearthFires.esm
with:
url: "https://gitlab.com/pospelov/se-data/-/raw/main/HearthFires.esm"
target: ${{github.workspace}}/skyrim_data_files/
- uses: suisei-cn/actions-download-file@v1
name: Download Dragonborn.esm
with:
url: "https://gitlab.com/pospelov/se-data/-/raw/main/Dragonborn.esm"
target: ${{github.workspace}}/skyrim_data_files/
- name: Prepare
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
options: |
-v ${{github.workspace}}:/src
-v ${{github.workspace}}/.cmake-js:/home/skymp/.cmake-js
run: |
chown -R skymp:skymp /src /home/skymp/.cmake-js
- name: CMake Configure
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
options: |
-v ${{github.workspace}}:/src
-v ${{github.workspace}}/.cmake-js:/home/skymp/.cmake-js
-u skymp
run: |
cd /src \
&& ./build.sh --configure \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DUNIT_DATA_DIR="/src/skyrim_data_files"
- name: Upload compile_commands.json
uses: actions/upload-artifact@v3
with:
name: compile_commands.json
path: ${{github.workspace}}/build/compile_commands.json
- name: Build
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
options: |
-v ${{github.workspace}}:/src
-v ${{github.workspace}}/.cmake-js:/home/skymp/.cmake-js
-u skymp
run: |
cd /src \
&& ./build.sh --build
- name: Prepare dist.tar.gz
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
options: |
-v ${{github.workspace}}:/src
-v ${{github.workspace}}/.cmake-js:/home/skymp/.cmake-js
-u skymp
run: |
cd /src/build \
&& tar czf dist.tar.gz dist
- name: Upload dist.tar.gz
uses: actions/upload-artifact@v3
with:
name: dist.tar.gz
path: ${{github.workspace}}/build/dist.tar.gz
- name: SP Types Check
run: |
commit=$(< ${{github.workspace}}/skyrim-platform/src/platform_se/codegen/convert-files/temp.txt)
build=$(< ${{github.workspace}}/build/dist/client/Data/Platform/Modules/skyrimPlatform.ts)
difference=$(diff -u <(echo "$commit") <(echo "$build"))
size=$(echo -n $difference | wc -m)
echo "Size $size"
if [ $size != 0 ] ; then
echo "SP Types in codegen and build dist not equal"
echo "Difference:"
echo $difference
exit 1
fi
echo "SP Types in codegen and build dist equal"
- name: Test
uses: addnab/docker-run-action@v3
with:
image: ${{ env.SKYMP_VCPKG_DEPS_IMAGE }}
options: |
-v ${{github.workspace}}:/src
-v ${{github.workspace}}/.cmake-js:/home/skymp/.cmake-js
-u skymp
run: |
cd /src/build \
&& ctest -C ${{env.BUILD_TYPE}} --verbose --output-on-failure