Skip to content

Commit

Permalink
700 switch to GitHub shared runner mac x86 (#703)
Browse files Browse the repository at this point in the history
* switched selfhosted to GH shared runner

* switched selfhosted to GH shared runner

* changed ci_windows workflow to work with github hosted runners and updated thirdparty.inc with new versions of prerequisite packages

* removed obsolete parts from ci_windows.yml

* Update ci_windows.yml

fixed typos

* removed commented and obsplete options

* restored thirdparty

* restored thirdparty

* restored thirdparty

* restored thirdparty
  • Loading branch information
maxb-io authored and udi-speedb committed Dec 6, 2023
1 parent ca59d36 commit d63f482
Show file tree
Hide file tree
Showing 2 changed files with 189 additions and 56 deletions.
52 changes: 33 additions & 19 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# This workflow will build Speedb on a Mac OS server
#
# This workflow assumes the self hosted runner on a Mac machine is ready.
# The Mac OS server must have all the tools and software required for Speedb building to be installed
name: Build on Mac


name: Build on Mac

on:
on:
workflow_call:
inputs:
verSion:
Expand All @@ -15,19 +9,39 @@ on:
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: macOSi86 # a test self hosted runner on a vm with MacOS
build-mac:
runs-on: macos-11

steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v3

- name: 'build'
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin' # See 'Supported distributions' for available options.
java-version: '8'
- name: build jar
run: |
export JAVA_HOME=/usr/local/opt/openjdk@11
export CPPFLAGS="-I/usr/local/opt/openjdk@11/include"
export CXXFLAGS="-I/usr/local/opt/openjdk@11/include"
ROCKSDB_DISABLE_JEMALLOC=1 PORTABLE=1 DEBUG_LEVEL=0 make -j 4 rocksdbjavastatic
- name: 'upload artifacts' #This step executed only when this workflow is called by another and a version is provided
echo $JAVA_HOME
export CPPFLAGS="-I$JAVA_HOME/include"
export CXXFLAGS="-I$JAVA_HOME/include"
brew install zlib
brew install bzip2 lz4 snappy
ROCKSDB_DISABLE_JEMALLOC=1 PORTABLE=1 DEBUG_LEVEL=0 make -j 2 rocksdbjavastatic
# - name: 'upload artifacts' #This step executed only when this workflow is called by another and a version is provided
# if: inputs.verSion != ' '
# run: aws s3 cp java/target/libspeedbjni-osx-x86_64.jnilib s3://spdb-builder/jar_test/v${{ inputs.verSion }}/libspeedbjni-osx-x86_64.jnilib

- name: Upload artifacts to S3
if: inputs.verSion != ' '
run: aws s3 cp java/target/libspeedbjni-osx-x86_64.jnilib s3://spdb-builder/jar_test/v${{ inputs.verSion }}/libspeedbjni-osx-x86_64.jnilib
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: java/target/libspeedbjni-osx-x86_64.jnilib
DEST_FILE: jar_test/v${{ inputs.verSion }}/libspeedbjni-osx-x86_64.jnilib
193 changes: 156 additions & 37 deletions .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# This workflow will build Speedb on a Windows server
#
# This workflow assumes the self hosted runner on a Windows machine is ready.
# The Windows server must have all the tools and software required for Speedb building to be installed
name: Build on Windows test


name: Build on Windows

on:
on:
workflow_call:
inputs:
verSion:
Expand All @@ -17,37 +11,162 @@ on:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
AWS_BUCKET:
AWS_BUCKET:
required: true

workflow_dispatch:

jobs:
build-and-deploy:
runs-on: win1 # a test self hosted runner on a win vm
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:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v3

- name: 'build and present'
shell: powershell # For Linux, use bash
run: |
$env:THIRDPARTY_HOME='C:/Users/builder/code'
cp $env:THIRDPARTY_HOME\thirdparty.inc . # copy the thirdparty.inc that reflects the env on the runner machine
mkdir runner_bld
cd runner_bld
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 -DJNI=1 -DGFLAGS=1 -DSNAPPY=1 -DLZ4=1 -DZLIB=1 -DZSTD=1 -DXPRESS=1 -DFAIL_ON_WARNINGS=0 ..
msbuild speedb.sln /p:Configuration=Release /t:speedbjni-shared
- 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: runner_bld\java\Release\speedbjni-shared.dll
DEST_FILE: jar_test/v${{ inputs.verSion }}/libspeedbjni-win64.dll
- 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
curl https://zlib.net/zlib13.zip -o zlib13.zip
Expand-Archive -Path zlib13.zip -DestinationPath zlib-tmp
mv .\zlib-tmp\zlib-1.3\ .
rmdir zlib-tmp
cd zlib-1.3\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\
mkdir build
cd build
#& $Env:CMAKE_BIN -G "$Env:CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=Debug -DOPTDBG=1 -DPORTABLE=1 -DSNAPPY=1 -DJNI=1 ..
& $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/rocksdb.sln -maxCpuCount -property:Configuration=Debug -property:Platform=x64
#msbuild.exe build/speedb.sln -maxCpuCount -property:Configuration=Debug -property:Platform=x64
#- name: 'build and present'
# shell: powershell # For Linux, use bash
# run: |
# $env:THIRDPARTY_HOME='C:/Users/builder/code'
# cp $env:THIRDPARTY_HOME\thirdparty.inc . # copy the thirdparty.inc that reflects the env on the runner machine
# mkdir runner_bld
# cd runner_bld
# cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 -DJNI=1 -DGFLAGS=1 -DSNAPPY=1 -DLZ4=1 -DZLIB=1 -DZSTD=1 -DXPRESS=1 -DFAIL_ON_WARNINGS=0 ..
# msbuild speedb.sln /p:Configuration=Release /t:speedbjni-shared

- 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: runner_bld\java\Release\speedbjni-shared.dll
DEST_FILE: jar_test/v${{ inputs.verSion }}/libspeedbjni-win64.dll

0 comments on commit d63f482

Please sign in to comment.