Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(IO2): Test CI flow #1

Merged
merged 44 commits into from
Oct 16, 2023
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
6169ab2
Feat(IO2): Test CI flow
magicaldave Oct 16, 2023
cef0147
Fix(IO2): Correct CI job formatting
magicaldave Oct 16, 2023
ddd2fce
Fix(CI): Fix event name
magicaldave Oct 16, 2023
1718f9e
Fix(CI): Make script executable
magicaldave Oct 16, 2023
9b803f2
FIx(CI): Don't use env
magicaldave Oct 16, 2023
0511c38
Fix(CI): Rename deps script
magicaldave Oct 16, 2023
b890320
Feat(CI): Install Boost
magicaldave Oct 16, 2023
5db1c93
Feat(CI): Fail on all errors and run boost from cwd explicitly
magicaldave Oct 16, 2023
385993b
Fix(CI): Unix path?
magicaldave Oct 16, 2023
49a6a6f
Feat(CI): Extract LuaJIT & Prepare Sol
magicaldave Oct 16, 2023
b693834
Fix(CI): Provide LUA_DIR from cmake call, not deps script
magicaldave Oct 16, 2023
55d20f9
Fix(CI): place environment variable in correct place
magicaldave Oct 16, 2023
aaf7775
Fix(CI): Change path separator
magicaldave Oct 16, 2023
f744859
Fix(CI): Actually extract LuaJIT to LuaJIT dir
magicaldave Oct 16, 2023
bbe5033
Fix(CI): Wow, you actually can't put a space there
magicaldave Oct 16, 2023
c8f2332
Fix(CI): Add lua51 lib option
magicaldave Oct 16, 2023
e75604c
Feat(CI): Cache deps
magicaldave Oct 16, 2023
82a7306
Feat(CI): Also cache sol
magicaldave Oct 16, 2023
20f1f8f
Fix(CI): Now run the build
magicaldave Oct 16, 2023
ce3dbe8
Test(CI): Where is boost
magicaldave Oct 16, 2023
20903c8
Test(CI): Enable Boost_USE_STATIC_LIBS
magicaldave Oct 16, 2023
2970bce
Feat(CI): Create release for related actions
magicaldave Oct 16, 2023
13e4362
Feat(CI): Upload release asset
magicaldave Oct 16, 2023
38e1d7d
Feat(CI): Don't spam logs with boost LS
magicaldave Oct 16, 2023
8d85c2f
Fix(CI): Change to allowed tag name
magicaldave Oct 16, 2023
5f0fb03
Fix(CI): Upload unconditionally
magicaldave Oct 16, 2023
5d58f01
Fix(CI): Update release name per build
magicaldave Oct 16, 2023
0908010
Fix(CI): Use current tag for uploading release
magicaldave Oct 16, 2023
388a625
Fix(CI): Change path separator
magicaldave Oct 16, 2023
b2fada8
Fix(CI): Make new release tag based on SHA
magicaldave Oct 16, 2023
4c043ba
Fix(CI): Change upload tag to use github sha
magicaldave Oct 16, 2023
fefffeb
Cleanup(CI): Don't use deprecated Create Release Action
magicaldave Oct 16, 2023
4221a6a
Test(CI): Attempt a tiny build
magicaldave Oct 16, 2023
3c0ac66
Feat(CI): Do builds as a matrix so all types are available
magicaldave Oct 16, 2023
ecdecd1
Fix(CI): Reorder matrix placement
magicaldave Oct 16, 2023
db118ff
Fix(CI): Change name of moved dll
magicaldave Oct 16, 2023
2ba3be2
Fix(CI): Change variable name so it actually moves
magicaldave Oct 16, 2023
f5c35fb
Fix(CI): Change env var syntax
magicaldave Oct 16, 2023
885546e
Test(CI): Shuffle around workflow dispatch
magicaldave Oct 16, 2023
c6a1cd3
Feat(CI): Upload artifacts instead of releases on PRs
magicaldave Oct 16, 2023
187474e
Fix(CI): Correct Artifact name
magicaldave Oct 16, 2023
7c9b64e
Fix(CI): Change to always release on same branch tag
magicaldave Oct 16, 2023
895e0bf
TEST-SQUASH(CI): Remove PR restriction to test multiple uploads to sa…
magicaldave Oct 16, 2023
80ef1c3
Fix(CI): Restore PR restriction
magicaldave Oct 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/io2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: IO2-Main

on:
workflow_dispatch:
push:
branches:
- 'master'
pull_request:
branches: [ master ]


jobs:
Windows:
strategy:
matrix:
build_type: [Release, RelWithDebInfo, MinSizeRel, Debug]
runs-on: windows-2022
env:
BUILD_DIR: D:/a/Lua-io2/Lua-io2/${{ matrix.build_type}}/

steps:
- uses: actions/checkout@v4

- name: Cache Boost
id: cache-LuaBoost
uses: actions/cache@v3
with:
path: |
C:/local/boost_1_80_0/
D:/a/Lua-io2/Lua-io2/LuaJIT/
D:/a/Lua-io2/Lua-io2/sol2/
key: ${{ runner.os }}-LuaBoost

- name: Get Deps (Boost, LuaJIT)
shell: bash
if: steps.cache-LuaBoost.outputs.cache-hit != 'true'
run: CI/get_win_deps.sh

- name: Configure
shell: bash
run: LUA_DIR=LuaJIT/ cmake .

- name: Build
run: |
cmake --build . --config ${{ matrix.build_type }}
mv ${{ env.BUILD_DIR }}/io2.dll ${{ env.BUILD_DIR }}/io2-${{ matrix.build_type }}.dll

- name: Upload Release
if: github.event_name != 'pull_request'
uses: softprops/action-gh-release@v1
with:
tag_name: Stable-CI
files: ${{ env.BUILD_DIR }}/io2-${{ matrix.build_type }}.dll
body: |
CI Build for Dreamweave IO2 fork

- name: Upload Artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
with:
path: ${{ env.BUILD_DIR }}/io2-${{ matrix.build_type }}.dll
name: io2-lua-${{ matrix.build_type }}
73 changes: 73 additions & 0 deletions CI/get_win_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
set -e

CMAKE_OPTS=""
add_cmake_opts() {
CMAKE_OPTS="$CMAKE_OPTS $@"
}

download() {
if [ $# -lt 3 ]; then
echo "Invalid parameters to download."
return 1
fi

NAME=$1
shift

echo "$NAME..."

while [ $# -gt 1 ]; do
URL=$1
FILE=$2
shift
shift

if ! [ -f $FILE ]; then
printf " Downloading $FILE... "

if [ -z $VERBOSE ]; then
RET=0
curl --silent --fail --retry 10 -Ly 5 -o $FILE $URL || RET=$?
else
RET=0
curl --fail --retry 10 -Ly 5 -o $FILE $URL || RET=$?
fi

if [ $RET -ne 0 ]; then
echo "Failed!"
wrappedExit $RET
else
echo "Done."
fi
else
echo " $FILE exists, skipping."
fi
done

if [ $# -ne 0 ]; then
echo "Missing parameter."
fi
}



download "LuaJIT v2.1.0-beta3-452-g7a0cf5fd" \
"https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/LuaJIT-v2.1.0-beta3-452-g7a0cf5fd-msvc2019-win64.7z" \
"LuaJIT-v2.1.0-beta3-452-g7a0cf5fd-msvc2019-win64.7z"



download "Boost 1.80.0" \
"https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/boost_1_80_0-msvc-14.3-64.exe" \
"boost-1.80.0-msvc14.3-win64.exe"

echo "Installing Boost . . ."
./boost-1.80.0-msvc14.3-win64.exe //DIR="${CWD_DRIVE_ROOT}" //VERYSILENT //NORESTART //SUPPRESSMSGBOXES //LOG='boost_install.log'

echo "Extracting LuaJIT . . ."
eval 7z x -y LuaJIT-v2.1.0-beta3-452-g7a0cf5fd-msvc2019-win64.7z -o./LuaJIT

echo "Praise the Sun!"
git submodule init && git submodule update

ls -laR
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ if (CMAKE_CXX_COMPILE_FEATURES MATCHES cxx_std_17 AND HAVE_FILESYSTEM_H)
add_definitions(-DHAVE_FILESYSTEM)
else()
set(CMAKE_CXX_STANDARD 14)
#set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED)
find_package(Boost COMPONENTS system filesystem REQUIRED)
endif()
2 changes: 1 addition & 1 deletion cmake/FindLuaJit.cmake
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ libfind_pkg_detect(LuaJit luajit
FIND_PATH luajit.h
HINTS $ENV{LUA_DIR}
PATH_SUFFIXES include include/luajit-2.1
FIND_LIBRARY luajit-5.1 luajit
FIND_LIBRARY luajit-5.1 luajit lua51
HINTS $ENV{LUA_DIR}
PATH_SUFFIXES lib
)