feat(skymp5-front): add a description of spell reset (#2283) #4
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
# TODO(#2280): rename from PR to something else (also applies to Windows etc) | |
# TODO(#2280): keep in line with deploy.yml | |
name: PR Linux | |
on: | |
pull_request: | |
# any | |
push: | |
branches: | |
- main | |
env: | |
BUILD_TYPE: RelWithDebInfo | |
jobs: | |
pr-docker: | |
strategy: | |
matrix: | |
base_system: | |
# The usual container used for all builds within the CI and the one | |
# we use as the base for server builds with preinstalled/cached deps | |
- ubuntu-vcpkg-deps | |
# Distros that our contributors are likely to run | |
- ubuntu-2204 | |
- ubuntu-2404 | |
- ubuntu-2410 # latest non-LTS | |
- debian-12 | |
- archlinux | |
# TODO(#2280): add Fedora | |
# TODO(#2280): test gcc build, test build w/o ninja | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Debug - print env | |
run: env | |
- name: Get/build image to use for building & testing | |
run: | | |
set -x # print executed commands | |
echo Some debug data | |
id | |
uname -a | |
lsb_release -a | |
# cat ${{github.workspace}}/misc/github_env_linux >> "$GITHUB_ENV" | |
# get base image for this distro (or build configuration, in case with skymp-deps) | |
base_image="`misc/deps_linux/${{ matrix.base_system }}.sh --get-image-uri`" | |
docker run \ | |
--name prepare_deps_container \ | |
-v "${{github.workspace}}:/src" \ | |
-w "/src" \ | |
-e "CI=$CI" \ | |
-e "CREATE_UID=`id -u`" \ | |
"$base_image" \ | |
'misc/deps_linux/${{ matrix.base_system }}.sh' '--ensure-deps-noninteractive' | |
docker commit prepare_deps_container localhost/buildimage | |
- name: Debug - check build tools | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: localhost/buildimage | |
options: | | |
-v ${{github.workspace}}:/src | |
-w /src | |
-u skymp | |
run: | | |
print_info_unsafe() { | |
echo . | |
echo . | |
echo "=== Checking $1 ===" | |
out="`which $1`" | |
ret="$?" | |
if [ "$ret" != 0 -o -z "$out" ]; then | |
echo "Which exited with $ret $out" | |
return | |
fi | |
ls -lh "$out" | |
echo "version call:" | |
"$out" --version | |
} | |
print_info() { | |
print_info_unsafe "$@" || true | |
} | |
print_info clang++ | |
print_info clang++-15 | |
print_info cmake | |
print_info ninja | |
print_info node | |
print_info yarn | |
print_info git | |
print_info zip | |
print_info unzip | |
print_info curl | |
echo . | |
echo . | |
echo === misc === | |
echo "current dir is $PWD" | |
echo /src: | |
ls -lh /src | |
echo . | |
echo . | |
echo === env === | |
./build.sh --print-env | |
- name: Store SP types from commit | |
run: | | |
id | |
ls -lh ${{github.workspace}}/skyrim-platform/src/platform_se/codegen/convert-files | |
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: localhost/buildimage | |
options: | | |
-v ${{github.workspace}}:/src | |
run: | | |
chown -R skymp:skymp /src | |
- name: CMake Configure | |
id: cmake_configure | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: localhost/buildimage | |
options: | | |
-v ${{github.workspace}}:/src | |
-u skymp | |
run: | | |
cd /src \ | |
&& ./build.sh --configure \ | |
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ | |
-DUNIT_DATA_DIR="/src/skyrim_data_files" | |
- name: Upload vcpkg logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{matrix.base_system}}_vcpkg_logs | |
path: | | |
${{github.workspace}}/build/vcpkg-bootstrap.log | |
${{github.workspace}}/vcpkg/buildtrees/**/*.log | |
- name: Upload compile_commands.json | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{matrix.base_system}}_compile_commands.json | |
path: ${{github.workspace}}/build/compile_commands.json | |
- name: Build | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: localhost/buildimage | |
options: | | |
-v ${{github.workspace}}:/src | |
-u skymp | |
run: | | |
cd /src \ | |
&& ./build.sh --build | |
- name: Prepare dist.tar.gz | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: localhost/buildimage | |
options: | | |
-v ${{github.workspace}}:/src | |
-u skymp | |
run: | | |
cd /src/build \ | |
&& tar czf dist.tar.gz dist | |
- name: Upload dist.tar.gz | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{matrix.base_system}}_dist.tar.gz | |
path: ${{github.workspace}}/build/dist.tar.gz | |
- name: SP Types Check | |
id: 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: SP Const Enums Check | |
id: sp_const_enums_check | |
run: | | |
cd skyrim-platform/tools/const_enum_extractor | |
sudo yarn install | |
sudo node ./index.js | |
# Checking if ConstEnumApi.cpp has changed | |
cd ../../../ | |
git diff --exit-code skyrim-platform/src/platform_se/skyrim_platform/ConstEnumApi.cpp | |
if [ $? -ne 0 ]; then | |
echo "ConstEnumApi.cpp has changed after running const_enum_extractor. Please re-run it locally and commit changes" | |
exit 1 | |
fi | |
- name: SP Types Check failed - Here is what you can do | |
if: ${{ failure() && steps.sp_types_check.outcome == 'failure' }} | |
run: | | |
echo "skyrimPlatform.ts and Definitions.txt do not match." | |
echo "You can fix this manually or simply build the project locally and commit the changes." | |
- name: SP Const Enums Check failed - Here is what you can do | |
if: ${{ failure() && steps.sp_const_enums_check.outcome == 'failure' }} | |
run: | | |
echo "ConstEnumApi.cpp has changed after running const_enum_extractor. Please re-run it locally and commit changes." | |
echo "In folder skyrim-platform/tools/const_enum_extractor run 'yarn install' and then 'node ./index.js'" | |
- name: Test | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: localhost/buildimage | |
options: | | |
-v ${{github.workspace}}:/src | |
-u skymp | |
run: | | |
cd /src/build \ | |
&& ctest -C ${{env.BUILD_TYPE}} --verbose --output-on-failure |