Build on Windows test #11
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
name: Build on Windows test | |
on: | |
workflow_call: | |
inputs: | |
verSion: | |
required: true | |
type: string | |
secrets: | |
AWS_ACCESS_KEY_ID: | |
required: true | |
AWS_SECRET_ACCESS_KEY: | |
required: true | |
AWS_BUCKET: | |
required: true | |
workflow_dispatch: | |
jobs: | |
build-windows: | |
runs-on: windows-2022 | |
env: | |
THIRDPARTY_HOME: C:/Users/runneradmin/thirdparty | |
CMAKE_HOME: C:/Program Files/CMake | |
CMAKE_BIN: C:/Program Files/CMake/bin/cmake.exe | |
SNAPPY_HOME: C:/Users/runneradmin/thirdparty/snappy-1.1.9 | |
SNAPPY_INCLUDE: C:/Users/runneradmin/thirdparty/snappy-1.1.9;C:/Users/circleci/thirdparty/snappy-1.1.9/build | |
SNAPPY_LIB_DEBUG: C:/Users/runneradmin/thirdparty/snappy-1.1.9/build/Debug/snappy.lib | |
CMAKE_GENERATOR: Visual Studio 17 2022 | |
CODE_HOME: C:/Users/runneradmin/code | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' # See 'Supported distributions' for available options | |
java-version: '8' | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v1.1 | |
- name: Setup VS Dev | |
uses: seanmiddleditch/gha-setup-vsdevenv@v4 | |
- name: install cmake | |
shell: powershell | |
run: | | |
echo "Installing CMake..." | |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y | |
- name: prepare Thirdparty home | |
shell: powershell | |
run: mkdir "$Env:THIRDPARTY_HOME" | |
- name: install snappy test | |
shell: powershell | |
run: | | |
mkdir $env:CODE_HOME | |
cd $env:CODE_HOME | |
curl https://github.com/google/snappy/archive/refs/tags/1.1.9.zip -o 1.1.9.zip | |
Expand-Archive -Path 1.1.9.zip -DestinationPath snappy-tmp | |
mv .\snappy-tmp\snappy-1.1.9\ . | |
rmdir .\snappy-tmp\ | |
cd .\snappy-1.1.9\ | |
mkdir build | |
cd .\build\ | |
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_GENERATOR_PLATFORM=x64 -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF .. | |
msbuild Snappy.sln /p:Configuration=Debug /p:Platform=x64 | |
msbuild Snappy.sln /p:Configuration=Release /p:Platform=x64 | |
- name: install snappy | |
shell: powershell | |
run: | | |
cd $Env:THIRDPARTY_HOME | |
curl https://github.com/google/snappy/archive/refs/tags/1.1.9.zip -O snappy-1.1.9.zip | |
Expand-Archive -Path snappy-1.1.9.zip -DestinationPath snappy-tmp | |
mv .\snappy-tmp\snappy-1.1.9\ . | |
cd snappy-1.1.9 | |
mkdir build | |
cd .\build | |
& cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_GENERATOR_PLATFORM=x64 -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF .. | |
msbuild.exe Snappy.sln -maxCpuCount -property:Configuration=Release -property:Platform=x64 | |
- name: install gflags | |
shell: powershell | |
run: | | |
cd $Env:THIRDPARTY_HOME | |
curl https://github.com/gflags/gflags/archive/refs/tags/v2.2.2.zip -o v2.2.2.zip | |
Expand-Archive -Path .\v2.2.2.zip -DestinationPath gflags-tmp | |
mv .\gflags-tmp\gflags-2.2.2 . | |
rmdir gflags-tmp | |
cd gflags-2.2.2 | |
mkdir target | |
cd target | |
cmake -G "Visual Studio 17 2022" -A x64 .. | |
msbuild gflags.sln /p:Configuration=Release /p:Platform=x64 | |
- name: install zlib | |
shell: powershell | |
run: | | |
cd $Env:THIRDPARTY_HOME | |
git clone https://github.com/maxb-io/zlib.git -b max1.3 zlib-1.3.1 | |
cd zlib-1.3.1\contrib\vstudio\vc14 | |
devenv zlibvc.sln /upgrade | |
cp ../../../zlib.h . | |
msbuild zlibvc.sln /p:Configuration=Debug /p:Platform=x64 | |
msbuild zlibvc.sln /p:Configuration=Release /p:Platform=x64 | |
copy x64\ZlibDllRelease\zlibwapi.lib x64\ZlibStatRelease\ | |
- name: install lz4 | |
shell: powershell | |
run: | | |
cd $Env:THIRDPARTY_HOME | |
curl https://github.com/lz4/lz4/archive/refs/tags/v1.9.2.zip -o lz4.zip | |
Expand-Archive -Path lz4.zip -DestinationPath lz4-tmp | |
mv .\lz4-tmp\lz4-1.9.2\ . | |
rmdir .\lz4-tmp\ | |
cd .\lz4-1.9.2\ | |
cd visual\VS2017 | |
devenv lz4.sln /upgrade | |
msbuild lz4.sln /p:Configuration=Release /p:Platform=x64 | |
- name: install zctd | |
shell: powershell | |
run: | | |
cd $Env:THIRDPARTY_HOME | |
curl https://github.com/facebook/zstd/archive/v1.5.2.zip -o zstd-tmp.zip | |
Expand-Archive -Path zstd-tmp.zip -DestinationPath zstd-tmp | |
mv .\zstd-tmp\zstd-1.5.2\ . | |
rmdir .\zstd-tmp\ | |
cd zstd-1.5.2\build\VS2010 | |
devenv zstd.sln /upgrade | |
msbuild zstd.sln /p:Configuration=Debug /p:Platform=x64 | |
msbuild zstd.sln /p:Configuration=Release /p:Platform=x64 | |
- name: Build Speedb | |
run: | | |
copy C:\Users\runneradmin\thirdparty\snappy-1.1.9\build\snappy-stubs-public.h C:\Users\runneradmin\thirdparty\snappy-1.1.9\ | |
copy tools\thirdparty.txt thirdparty.inc # copy the thirdparty.inc that reflects the env on the runner machine | |
mkdir build | |
cd build | |
& $Env:CMAKE_BIN -G "$Env:CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=20 -A x64 -DJNI=1 -DGFLAGS=1 -DOPTDBG=1 -DPORTABLE=1 -DSNAPPY=1 -DJNI=1 -DSNAPPY=1 -DLZ4=1 -DZLIB=1 -DZSTD=1 -DXPRESS=1 -DFAIL_ON_WARNINGS=0 .. | |
cd .. | |
echo "Building with VS version: $Env:CMAKE_GENERATOR" | |
msbuild build/speedb.sln /p:Configuration=Release /t:speedbjni-shared | |
#msbuild.exe build/speedb.sln -maxCpuCount -property:Configuration=Debug -property:Platform=x64 | |
- name: Upload artifacts to S3 | |
if: inputs.verSion != ' ' | |
uses: NotCoffee418/s3-zip-upload@v1 | |
env: | |
AWS_SECRET_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_BUCKET: ${{ secrets.AWS_BUCKET }} | |
BUCKET_NAME: spdb-builder | |
AWS_REGION: us-east-1 | |
SOURCE_MODE: FILE | |
SOURCE_PATH: build\java\Release\speedbjni-shared.dll | |
DEST_FILE: jar_test/v${{ inputs.verSion }}/libspeedbjni-win64.dll |